Prop Class
Lismでは、主要なCSSプロパティ群に対して、それらで頻繁に使用される値やトークンを手軽にセットできるようなユーティリティクラスを用意しています。
さらに、その中でも特に重要なCSSプロパティについてはブレイクポイント指定用クラスも用意しています。
それらを Prop Class と呼んでおり、-{prop}(:{value}), -{prop}_{bp} という形式で定義しています。
このページでは、その Prop Classの一覧を紹介します。
SCSSでカスタマイズすることで、出力するクラスの種類は変更できます。
このページの表の見方
Section titled “このページの表の見方”ここからはテーブル形式で、各プロパティの情報をまとめていきます。
| カラム名 | 説明 |
|---|---|
| Property | CSSプロパティ |
| Shorthand | その省略形。Propクラスの-{prop}:{val}の{prop}にあたる文字列です。また、Lismコンポーネントに指定するためのプロパティ名もこの文字列です。 |
| To Class | Prop Utility クラスとして出力される値 |
| BP | ブレイクポイント対応クラス(-{prop}_{bp})サポートの有無 |
省略形の文字列(Shorthand)は、クラスとして出力されます。また、Lismコンポーネントに指定するプロパティも、この文字列です。
Typography
Section titled “Typography”| Property | Shorthand | To Class | BP |
|---|---|---|---|
font | f | inherit | - |
font-size | fz | TYPE.FZ | ○ |
font-family | ff | TYPE.FF | - |
font-weight | fw | TYPE.FW | - |
font-style | fs | italic | - |
line-height | lh | TYPE.LH, 1 | - |
letter-spacing | lts | TYPE.LTS | - |
text-align | ta | centerleftright | - |
text-decoration | td | noneunder | - |
Example text
<p class='-fz:xl -fw:bold -lts:l -ta:center'>Example text</p>writing-mode
Section titled “writing-mode”| Property | Shorthand | To Class | BP |
|---|---|---|---|
writing-mode | writing | vertical | ⚪︎ |
縦書き用の値は、トークン(--writing--vertical)で管理しています。 (これにより、lang属性に合わせて変数を上書きすることで、vertical-rlかvertical-lrを切り替えることができるようにもなっています。)
ロレム・イプサムの座り雨、トマ好き学習だったエリット、しかし時と活力はそのような木々と楽しみ。
ブラインド行うにはいくつかの重要な事柄が流れます。長年にわたり、私は学区と長寿であれば、そのような Liberroy, Foo の取り組み、我らのうち、Mulla Sunt の利点を提案したのなら。
<div class='l--box -h -w:100% -writing:vertical' style='--h:20em'> <div class='l--flow has--gutter'> <p>ロレム・イプサムの座り雨、トマ好き学習だったエリット、しかし時と活力はそのような木々と楽しみ。</p> <p>ブラインド行うにはいくつかの重要な事柄が流れます。長年にわたり、私は学区と長寿であれば、そのような Liberroy,...</p> </div></div>Colors
Section titled “Colors”| Property | Shorthand | To Class | BP |
|---|---|---|---|
color | c | main,accenttext,text-2,base,inherittrsp(transparent) | - |
background-color | bgc | main,accentbase,base-2,text,inherittrsp(transparent) | - |
--bdc | bdc | main,accentline,inherit,trsp(transparent) | - |
Example text
<p class='-c:main -bgc:base-2 -bd -bdc:line -p:40'>Example text</p>関連トークン: COLOR
Spacing
Section titled “Spacing”Padding
Section titled “Padding”| Property | Shorthand | To Class | BP |
|---|---|---|---|
padding | p | SPACE | ○ |
padding-inline | px | SPACE | ○ |
padding-block | py | SPACE | ○ |
padding-inline-start | px-s | - | ○ |
padding-inline-end | px-e | - | ○ |
padding-block-start | py-s | - | ○ |
padding-block-end | py-e | - | ○ |
padding-left | pl | - | ○ |
padding-right | pr | - | ○ |
padding-top | pt | - | ○ |
padding-bottom | pb | - | ○ |
Margin
Section titled “Margin”| Property | Shorthand | To Class | BP |
|---|---|---|---|
margin | m | auto, SPACE | ○ |
margin-inline | mx | auto, SPACE | ○ |
margin-block | my | auto, SPACE | ○ |
margin-inline-start | mx-s | auto | ○ |
margin-inline-end | mx-e | auto | ○ |
margin-block-start | my-s | auto, SPACE | ○ |
margin-block-end | my-e | auto | ○ |
margin-left | ml | auto | ○ |
margin-right | mr | auto | ○ |
margin-top | mt | auto | ○ |
margin-bottom | mb | auto | ○ |
Example text
Example text
<div class="-p:20 -p_sm -bd" style="--p_sm:var(--s30)"> <p>Example text</p> <p class="-my-s:20 -mx:40">Example text</p></div>Width & Height
Section titled “Width & Height”| Property | Shorthand | To Class | BP |
|---|---|---|---|
width | w | 100%,fit(fit-content) | ○ |
height | h | 100% | ○ |
max-width | max-w | 100% | ○ |
max-height | max-h | 100% | ○ |
min-width | min-w | 100% | ○ |
min-height | min-h | 100% | ○ |
inline-size | sz | - | - |
max-inline-size | max-sz | s,m,l,xl,outer,full | - |
min-inline-size | min-sz | - | - |
block-size | ysz | - | - |
max-block-size | max-ysz | - | - |
min-block-size | min-ysz | - | - |
関連トークン: SIZE
Displays
Section titled “Displays”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
display | d | none,block,in-flex(inline-flex) | ○ |
visibility | v | hidden | - |
opacity | op | OPACITY, 0 | - |
overflow | ov | auto, clip, hidden | - |
overflow-x | ovx | auto, clip, scroll | - |
overflow-y | ovy | auto, clip, scroll | - |
aspect-ratio | ar | 21/9,16/9,3/2,1/1,og | ○ |
Positions
Section titled “Positions”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
position | pos | rel(relative),abs(absolute),static,fixed,sticky | - |
top | t | 0,50%,100% | - |
left | l | 0,50%,100% | - |
right | r | 0,50%,100% | - |
bottom | b | 0,50%,100% | - |
z-index | z | -1, 0, 1, 99 | - |
inset | i | 0 | - |
inset-inline | i-x | - | - |
inset-block | i-y | - | - |
inset-inline-start | i-x-s | - | - |
inset-inline-end | i-x-e | - | - |
inset-block-start | i-y-s | - | - |
inset-block-end | i-y-e | - | - |
position:absoluteで要素を配置する例をいくつか紹介します。
配置の指定例
<Box pos='rel' ar='3/2' lh='1'> <Box pos='abs' l='0' t='0' bd p='20'>A</Box> <Box pos='abs' l='50%' t='0' translate='-50X' bd p='20'>B</Box> <Box pos='abs' r='0' t='0' bd p='20'>C</Box> <Box pos='abs' l='0' t='50%' translate='-50Y' bd p='20'>D</Box> <Box pos='abs' l='50%' t='50%' translate='-50XY' bd p='20'>E</Box> <Box pos='abs' r='0' t='50%' translate='-50Y' bd p='20'>F</Box> <Box pos='abs' l='0' b='0' bd p='20'>G</Box> <Box pos='abs' l='50%' b='0' translate='-50X' bd p='20'>H</Box> <Box pos='abs' r='0' b='0' bd p='20'>I</Box></Box>Layouts
Section titled “Layouts”| Property | Shorthand | To Class | BP |
|---|---|---|---|
gap | g | SPACE,inherit | ○ |
column-gap | g-x | - | ○ |
row-gap | g-y | - | ○ |
| Prop | Shorthand | To Class | BP |
|---|---|---|---|
flex-wrap | fxw | wrap | ○ |
flex-direction | fxd | col(column),col-r(column-reverse),row-r(row-reverse) | ○ |
flex | fx | 1 | ○ |
flex-shrink | fxsh | 0 | - |
flex-grow | fxg | 1 | - |
flex-basis | fxb | - | ○ |
| Prop | Shorthand | To Class | BP |
|---|---|---|---|
grid-template | gt | - | ○ |
grid-template-areas | gta | - | ○ |
grid-template-columns | gtc | subgrid | ○ |
grid-template-rows | gtr | subgrid | ○ |
grid-auto-flow | gaf | col(column),row | ○ |
grid-auto-rows | gar | - | - |
grid-auto-columns | gac | - | - |
grid-area | ga | 1/1 | ○ |
grid-column | gc | 1/-1 | ○ |
grid-row | gr | 1/-1 | ○ |
grid-column-start | gcs | - | - |
grid-row-start | grs | - | - |
grid-column-end | gce | - | - |
grid-row-end | gre | - | - |
Places
Section titled “Places”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
align-items | ai | center, start, end, flex-s, flex-e, stretch | ⚪︎ |
align-content | ac | center, start, end, flex-s, flex-e, between | ⚪︎ |
justify-items | ji | center, start, end, flex-s, flex-e, stretch | ⚪︎ |
justify-content | jc | center, start, end, flex-s, flex-e, between | ⚪︎ |
align-self | aslf | center, start, end, stretch | - |
justify-self | jslf | center, start, end, stretch | - |
order | order | -1, 0, 1 | - |
Styling
Section titled “Styling”Shadow
Section titled “Shadow”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
box-shadow | bxsh | SHADOW | - |
Radius
Section titled “Radius”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
border-radius | bdrs | RADIUS | ○ |
Border
Section titled “Border”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
border | bd | none | - |
--bdc | bdc | line(--c--line), inherit | - |
--bds | bds | dashed,dotted,double | - |
--bdw | bdw | - | ○ |
border-top | bd-t | - | - |
border-right | bd-r | - | - |
border-bottom | bd-b | - | - |
border-left | bd-l | - | - |
border-inline | bd-x | - | - |
border-block | bd-y | - | - |
border-inline-start | bd-x-s | - | - |
border-inline-end | bd-x-e | - | - |
border-block-start | bd-y-s | - | - |
border-block-end | bd-y-e | - | - |
borderに関する仕様は少し特殊になっています。詳しくはborderページをご覧ください。
Background
Section titled “Background”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
background | bg | - | ⚪︎ |
background-image | bgi | - | - |
background-position | bgp | center | - |
background-size | bgsz | cover, contain | - |
background-repeat | bgr | no(no-repeat) | - |
background-attachment | bga | - | - |
background-origin | bgo | - | - |
background-clip | bgclip | text | - |
background-blend-mode | bgblend | - | - |
<Columns g='20'> <Frame ar='16/9' bg='url(/img/pattern.png) center / 4rem'></Frame> <Frame ar='16/9' bgi='url(/img/pattern.png)' bgp='center' bgsz='4rem' bgblend='difference' bgc='white'></Frame></Columns><Frame p='50' bg='linear-gradient(to top, #a8edea 0%, #fed6e3 100%)'>Gradient</Frame>TEXT
<Center> <Box bg='linear-gradient(45deg, var(--blue), var(--pink))' bgclip='text' c='trsp'> <HTML.p fz='5xl' fw='bold' lh='1' lts='l'>TEXT</HTML.p> </Box></Center>Transforms
Section titled “Transforms”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
translate | translate | -50X,-50Y,-50XY | - |
rotate | rotate | 45,-45,90,-90 | - |
scale | scale | -X,-Y,-XY | - |
Other CSS
Section titled “Other CSS”| Prop | Shorthand | To Class | BP |
|---|---|---|---|
float | float | left,right | - |
clear | clear | both | - |
isolation | isolation | isolate | - |
overflow-wrap | ovwrap | any(anywhere) | - |
white-space | whitespace | nowrap | - |