0.0.9 • Published 7 years ago

class-tools v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Class Tools

CSS-UTILS is a css library that offer util classes frequently-used.

Size

Easily set element width or height use short classes.

ClassNameExampleRangeDescription
w-x.w-1005,10...500设置元素的宽度为 100px
h-x.h-1005,10...500设置元素的高度为 100px
pct-x.pct-501,2...99,100设置元素的宽度为 50%

Space

Set padding or margin from elements.

ClassNameExampleRangeDescription
p-x.p-100, 5, ...100padding: 10px
pl-x.pl-100, 5, ...100padding-left: 10px
pr-x.pr-100, 5, ...100padding-right: 10px
pt-x.pt-100, 5, ...100padding-top: 10px
pb-x.pb-100, 5, ...100padding-bottom: 10px
pv-x.pv-100, 5, ...100padding-top:10px;padding-bottom:10px;
ph-x.ph-100, 5, ...100padding-left:10px;padding-right:10px;
ClassNameExampleRangeDescription
m-x.m-100, 5, ...100margin: 10px
ml-x.ml-100, 5, ...100margin-left: 10px
mr-x.mr-100, 5, ...100margin-right: 10px
mt-x.mt-100, 5, ...100margin-top: 10px
mb-x.mb-100, 5, ...100margin-bottom: 10px
mv-x.mv-100, 5, ...100margin-top:10px;margin-bottom:10px;
mv-automargin-left: auto;margin-right: auto
mh-x.mh-100, 5, ...100margin-left:10px;margin-right:10px;

Text

The following utils can be used to add additional styles to texts.

ClassNameDescription
.ellipsis文字溢出时沈略
.nowrap文字不换行
.lowercase转化为小写字母
.uppercase转化为大写字母
.capitalize转化为首字母大写
.bold文字粗体
.italic文字斜体
.tr文字右对齐 ➡️
.tl文字左对齐 ←
.tc文字居中对齐
.vt文字垂直顶部对齐
.vm文字垂直居中对齐
.vb文字垂直底部对齐

Float

ClassNameDescription
.frfloat right
.flfloat left
.clearfix添加在容器上清除浮动

Display

ClassNameDescription
.inlinedisplay inline
.blockdisplay block
.inline-blockdisplay inlin-block
.nonedisplay none

Position

ClassNameDescription
.relativeposition relative
.absoluteposition absolute
.fixedposition fixed
.stickyposition fixed
.top附着在顶部
.bottom附着在底部
.left附着在左侧
.right附着在右侧
.fillin填充整个容器

Pointer

ClassNameDescription
.pointercursor pointer
.not-allowedcursor not-allowed
.helpcursor help

Visibility

ClassNameDescription
.hiddenvisibility hidden
.visiblevisibility visible
.hover-pre-visiblevisible when hover previous sibling
.hover-parent-visiblevisible when hover parent
.hover-self-visiblevisible when hover self
.focus-pre-visiblevisible when focus previous sibling
.focus-parent-visiblevisible when focus parent
0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago