Bulma 有 2 个变量文件分成 4 部分:
-
初始变量:通过字面值定义变量,例如:
- 颜色:
$blue: hsl(229, 53%, 53%)
- 字号:
$size-1: 3rem
- 尺寸:
$gap: 32px
- 其它值:
$easing: ease-out
or$radius-large: 6px
- 颜色:
-
衍生变量:通过前面文件中变量的值计算而来。例如,您可以得到:
-
主颜色衍生自初始变量:
$primary: $turquoise
$link: $blue
$info: $cyan
$success: $green
$warning: $yellow
$danger: $red
$dark: $grey-darker
$text: $grey-dark
$background: $white-ter
: 常用背景色$link: $blue
: 链接使用主色$family-primary: $family-sans-serif
: 主字体族是 sans-serif-
列表和映射是已定义变量集合:
$colors: mergeColorMaps(("white": ($white, $black), "black": ($black, $white), "light": ($light, $light-invert), "dark": ($dark, $dark-invert), "primary": ($primary, $primary-invert, $primary-light, $primary-dark), "link": ($link, $link-invert, $link-light, $link-dark), "info": ($info, $info-invert, $info-light, $info-dark), "success": ($success, $success-invert, $success-light, $success-dark), "warning": ($warning, $warning-invert, $warning-light, $warning-dark), "danger": ($danger, $danger-invert, $danger-light, $danger-dark)), $custom-colors)
$shades: mergeColorMaps(("black-bis": $black-bis, "black-ter": $black-ter, "grey-darker": $grey-darker, "grey-dark": $grey-dark, "grey": $grey, "grey-light": $grey-light, "grey-lighter": $grey-lighter, "white-ter": $white-ter, "white-bis": $white-bis), $custom-shades)
$sizes: $size-1 $size-2 $size-3 $size-4 $size-5 $size-6 $size-7
-
主颜色衍生自初始变量:
要重新设置任何这些变量,只需在导入 Bulma 之前 设置即可。