Property Class
Lismでは、主要なCSSプロパティ群に対して、それらで頻繁に使用される値やトークンを手軽にセットできるようなユーティリティクラスを用意しています。
さらに、その中でも特に重要なCSSプロパティについてはブレイクポイント指定用クラスも用意しています。
それらを Property Class と呼んでおり、-{prop}(:{value}), -{prop}_{bp} という形式で定義しています。
このページでは、その Property Classの一覧を紹介します。
SCSSでカスタマイズすることで、出力するクラスの種類は変更できます。
このページの表の見方
ここからはテーブル形式で、各プロパティの情報をまとめていきます。
| カラム名 | 説明 |
|---|---|
| Shorthand | CSSプロパティの省略形。Propertyクラスの-{prop}:{val}の{prop}にあたる文字列です。また、Lismコンポーネントに指定するためのプロパティ名もこの文字列です。 |
| Property | 対応するCSSプロパティ |
| To Class | Property Utility クラスとして出力される値 |
| BP | ブレイクポイント対応クラス(-{prop}_{bp})サポートの有無 |
省略形の文字列(Shorthand)は、クラスとして出力されます。また、Lismコンポーネントに指定するプロパティも、この文字列です。
Typography
| Shorthand | Property | To Class | BP |
|---|---|---|---|
f | font | inherit | - |
fz | font-size | FZ | ✔ |
ff | font-family | FF | - |
fw | font-weight | FW | - |
fs | font-style | italic | - |
lh | line-height | LH, 1 | - |
lts | letter-spacing | LTS | - |
ta | text-align | centerleftright | - |
td | text-decoration | none | - |
tt | text-transform | upperlower | - |
↓
Examples
Example text
<p class="-fz:xl -fw:bold -lts:l -ta:center -tt:upper">Example text</p>Colors
| Shorthand | Property | To Class | BP |
|---|---|---|---|
c | color | brand,accenttext,text-2,base,inherit | - |
bgc | background-color | brand,accentbase,base-2,text,inherittransparent | - |
bdc | --bdc | brand,accentdivider,inherit,transparent,current | - |
↓
Examples
Example text
<p class="-c:brand -bgc:base-2 -bdc:current -bd -p:30">Example text</p>関連トークン: COLOR
Spacing
Padding
| Shorthand | Property | To Class | BP |
|---|---|---|---|
p | padding | SPACE | ✔ |
px | padding-inline | SPACE | ✔ |
py | padding-block | SPACE | ✔ |
px-s | padding-inline-start | - | ✔ |
px-e | padding-inline-end | - | ✔ |
py-s | padding-block-start | - | ✔ |
py-e | padding-block-end | - | ✔ |
pl | padding-left | - | ✔ |
pr | padding-right | - | ✔ |
pt | padding-top | - | ✔ |
pb | padding-bottom | - | ✔ |
Margin
| Shorthand | Property | To Class | BP |
|---|---|---|---|
m | margin | auto, SPACE | ✔ |
mx | margin-inline | auto, SPACE | ✔ |
my | margin-block | auto, SPACE | ✔ |
mx-s | margin-inline-start | auto | ✔ |
mx-e | margin-inline-end | auto | ✔ |
my-s | margin-block-start | auto, SPACE | ✔ |
my-e | margin-block-end | auto | ✔ |
ml | margin-left | - | ✔ |
mr | margin-right | - | ✔ |
mt | margin-top | - | ✔ |
mb | margin-bottom | - | ✔ |
↓
Space Examples
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:30">Example text</p></div>Width & Height
| Shorthand | Property | To Class | BP |
|---|---|---|---|
w | width | 100%,fit(fit-content) | ✔ |
h | height | 100%,fit(fit-content) | ✔ |
max-w | max-width | 100% | ✔ |
max-h | max-height | 100% | ✔ |
min-w | min-width | 100% | ✔ |
min-h | min-height | 100% | ✔ |
sz | inline-size | - | - |
max-sz | max-inline-size | xs,s,m,l,xl,min,full,container | - |
min-sz | min-inline-size | - | - |
ysz | block-size | - | - |
max-ysz | max-block-size | - | - |
min-ysz | min-block-size | - | - |
関連トークン: SIZE
↓
Examples
Example text
<div class="-w:fit -h -bgc:base-2 -p:10 -bd" style="--h:5em">Example text</div>Displays
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
d | display | none,block,flex,inline-flex,grid,inline-grid,inline,inline-block | ✔ |
v | visibility | hidden | - |
o | opacity | OPACITY, 0 | - |
ov | overflow | auto, clip, hidden | - |
ov-x | overflow-x | auto, clip, scroll | - |
ov-y | overflow-y | auto, clip, scroll | - |
ar | aspect-ratio | 21/9,16/9,3/2,1/1,og | ✔ |
↓
Examples
Box
Text
<div> <p class="-d:inline-flex -ar:1/1 -p:20 -bgc:base-2 -bd">Box</p> <p class="-d:inline-flex -o:-20 -px:20">Text</p></div>Positions
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
pos | position | relative,absolute,static,fixed,sticky | - |
t | top | 0,50%,100% | - |
l | left | 0,50%,100% | - |
r | right | 0,50%,100% | - |
b | bottom | 0,50%,100% | - |
z | z-index | -1, 0, 1, 99 | - |
i | inset | 0 | - |
i-x | inset-inline | - | - |
i-y | inset-block | - | - |
i-x-s | inset-inline-start | - | - |
i-x-e | inset-inline-end | - | - |
i-y-s | inset-block-start | - | - |
i-y-e | inset-block-end | - | - |
position:absoluteで要素を配置する例をいくつか紹介します。
↓
配置の指定例
A
B
C
D
E
F
G
H
I
リサイズ可能
<div class="l--box -pos:relative -ar:16/9 -lh:1 -ff:mono"> <div class="-pos:absolute -l:0 -t:0 -bgc:base-2 -bd -p:10">A</div> <div class="-pos:absolute -l:0 -r:0 -w:fit -mx:auto -bgc:base-2 -bd -p:10">B</div> <div class="-pos:absolute -r:0 -t:0 -bgc:base-2 -bd -p:10">C</div> <div class="-pos:absolute -l:0 -t:0 -b:0 -h:fit -my:auto -bgc:base-2 -bd -p:10">D</div> <div class="-pos:absolute -i:0 -m:auto -w:fit -h:fit -bgc:base-2 -bd -p:10">E</div> <div class="-pos:absolute -r:0 -t:0 -b:0 -h:fit -my:auto -bgc:base-2 -bd -p:10">F</div> <div class="-pos:absolute -l:0 -b:0 -bgc:base-2 -bd -p:10">G</div> <div class="-pos:absolute -l:0 -r:0 -b:0 -w:fit -mx:auto -bgc:base-2 -bd -p:10">H</div> <div class="-pos:absolute -r:0 -b:0 -bgc:base-2 -bd -p:10">I</div></div>Layouts
Gap
| Shorthand | Property | To Class | BP |
|---|---|---|---|
g | gap | SPACE,inherit | ✔ |
cg | column-gap | - | ✔ |
rg | row-gap | - | ✔ |
Flex
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
fxw | flex-wrap | wrap | ✔ |
fxd | flex-direction | column,column-reverse,row-reverse | ✔ |
fx | flex | 1 | ✔ |
fxsh | flex-shrink | 0 | - |
fxg | flex-grow | 1 | - |
fxb | flex-basis | - | ✔ |
↓
Examples
Item
Item
Item
<div class="l--flex -g:20"> <div class="-fxg:1 -bd -p:10 -bgc:base-2">Item</div> <div class="-fxg:2 -bd -p:10 -bgc:base-2">Item</div> <div class="-fxg:1 -bd -p:10 -bgc:base-2">Item</div></div>Grid
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
gt | grid-template | - | ✔ |
gta | grid-template-areas | - | ✔ |
gtc | grid-template-columns | subgrid | ✔ |
gtr | grid-template-rows | subgrid | ✔ |
gaf | grid-auto-flow | column,row | ✔ |
gar | grid-auto-rows | - | - |
gac | grid-auto-columns | - | - |
ga | grid-area | 1/1 | ✔ |
gc | grid-column | 1/-1 | ✔ |
gr | grid-row | 1/-1 | ✔ |
gcs | grid-column-start | - | - |
grs | grid-row-start | - | - |
gce | grid-column-end | - | - |
gre | grid-row-end | - | - |
↓
Examples
Item A
Item B
Item C
<div class="l--grid -g:20 -gtc" style="--gtc: repeat(2, 1fr)"> <div class="-gc:1/-1 -bd -p:10 -bgc:base-2">Item A</div> <div class="-bd -p:10 -bgc:base-2">Item B</div> <div class="-bd -p:10 -bgc:base-2">Item C</div></div>Places
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
ai | align-items | center, start, end, flex-start, flex-end, stretch | ✔ |
ac | align-content | center, start, end, flex-start, flex-end, between | ✔ |
ji | justify-items | center, start, end, flex-start, flex-end, stretch | ✔ |
jc | justify-content | center, start, end, flex-start, flex-end, between | ✔ |
aslf | align-self | center, start, end, stretch | - |
jslf | justify-self | center, start, end, stretch | - |
order | order | -1, 0, 1 | - |
↓
Examples
Item 1
Item 2
<div class="l--flex -jc:between"> <div class="-bd -p:10 -bgc:base-2">Item 1</div> <div class="-bd -p:10 -bgc:base-2">Item 2</div></div>Styling
Shadow & Radius
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
bxsh | box-shadow | SHADOW | ✔ |
bdrs | border-radius | RADIUS | ✔ |
↓
Examples
Box
<div class="-bxsh:20 -bdrs:20 -p:20 -bd">Box</div>Border
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
bd | border | none | - |
bdc | --bdc | brand,accentdivider,inherit,transparent,current | - |
bds | --bds | dashed,dotted,double | - |
bdw | --bdw | - | ✔ |
bd-t | border-top | - | - |
bd-r | border-right | - | - |
bd-b | border-bottom | - | - |
bd-l | border-left | - | - |
bd-x | border-inline | - | - |
bd-y | border-block | - | - |
bd-x-s | border-inline-start | - | - |
bd-x-e | border-inline-end | - | - |
bd-y-s | border-block-start | - | - |
bd-y-e | border-block-end | - | - |
↓
Examples
Box
<div class="-bd -bdc:current -bds:dashed -p:20" style="--bdw:2px"><p>Box</p></div>borderに関する仕様は少し特殊になっています。詳しくはborderページをご覧ください。
Background
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
bg | background | - | ✔ |
bgc | background-color | brand,accentbase,base-2,text,inherittransparent | - |
bgi | background-image | - | - |
bgr | background-repeat | no-repeat | - |
bgp | background-position | center | - |
bgsz | background-size | cover,contain | - |
Other CSS
| Shorthand | Prop | To Class | BP |
|---|---|---|---|
float | float | left,right | - |
clear | clear | both | - |
isolation | isolation | isolate | - |
ovwrap | overflow-wrap | anywhere | - |
whspace | white-space | nowrap | - |
↓
Examples
whspace: nowrap — この長いテキストは折り返さずにはみ出します
<p class="-whspace:nowrap -ov:hidden -bd -p:10 -bgc:base-2 -max-sz:s"> whspace: nowrap — この長いテキストは折り返さずにはみ出します</p>