General
functions
convert
@function convert($unit, $value, $base-font-size: null) { ... }
View sourceDescription
Converts one or more pixel values into matching rem (or em) values.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$unit | 单位名称(一般是em或rem) | String | —none |
$value | One or more values to convert. Be sure to separate them with spaces and not commas. If you need to convert a comma-separated list, wrap the list in parentheses. | Number or List | —none |
$base-font-size | The base value to use when calculating the | Number | null |
Returns
List
—A list of converted values.
Requires
- [function]
strip-units
- [function]
number
Used by
Links
px2rem
@function px2rem($value, $base-font-size: null) { ... }
View sourceDescription
Converts a unitless, pixel, or rem value to em, for use in breakpoints.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$value | One or more values to convert. Be sure to separate them with spaces and not commas. If you need to convert a comma-separated list, wrap the list in parentheses. | Number or List | —none |
$base-font-size | The base value to use when calculating the | Number | null |
Requires
- [function]
convert
Used by
- [mixin]
body
- [mixin]
heading
- [mixin]
sgl-margins
px2em
@function px2em($value, $base-font-size: null) { ... }
View sourceDescription
Converts a unitless, pixel, or rem value to em, for use in breakpoints.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$value | One or more values to convert. Be sure to separate them with spaces and not commas. If you need to convert a comma-separated list, wrap the list in parentheses. | Number or List | —none |
$base-font-size | The base value to use when calculating the | Number | null |
Requires
- [function]
convert
Used by
- [mixin]
body
- [mixin]
heading
- [mixin]
sgl-margins
decimal-round
@function decimal-round($number, $digits: 0, $mode: round) { ... }
View sourceDescription
Round a number to specified digits
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$number | A number to round | Number | —none |
$digits | Digits to output | Number | 0 |
$mode | (round|ceil|floor) How to round a number | String | round |
Returns
Number
—A rounded number
Example
decimal-round(0.333) => 0
decimal-round(0.333, 1) => 0.3
decimal-round(0.333, 2) => 0.33
decimal-round(0.666) => 1
decimal-round(0.666, 1) => 0.7
decimal-round(0.666, 2) => 0.67
Used by
- [function]
decimal-ceil
- [function]
decimal-floor
Links
Author
terkel
decimal-ceil
@function decimal-ceil($number, $digits: 0) { ... }
View sourceDescription
Ceil a number to specified digits.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$number | A number to round | Number | —none |
$digits | Digits to output | Number | 0 |
Returns
Number
—A ceiled number
Example
decimal-ceil(0.333) => 1
decimal-ceil(0.333, 1) => 0.4
decimal-ceil(0.333, 2) => 0.34
decimal-ceil(0.666) => 1
decimal-ceil(0.666, 1) => 0.7
decimal-ceil(0.666, 2) => 0.67
Requires
- [function]
decimal-round
Used by
- [mixin]
body
- [mixin]
heading
- [mixin]
sgl-margins
Links
Author
terkel
decimal-floor
@function decimal-floor($number, $digits: 0) { ... }
View sourceDescription
Floor a number to specified digits.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$number | A number to round | Number | —none |
$digits | Digits to output | Number | 0 |
Returns
Number
—A floored number
Example
decimal-floor(0.333) => 0
decimal-floor(0.333, 1) => 0.3
decimal-floor(0.333, 2) => 0.33
decimal-floor(0.666) => 0
decimal-floor(0.666, 1) => 0.6
decimal-floor(0.666, 2) => 0.66
Requires
- [function]
decimal-round
Links
Author
terkel
exponent
@function exponent($base, $exponent) { ... }
View sourceDescription
Exponent
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$base | —none | Number | —none |
$exponent | —none | Number | —none |
Used by
- [mixin]
heading
Links
Author
scottkellum
number
@function number($string) { ... }
View sourceDescription
将字符串转换成数字
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$string | —none | String | —none |
Requires
- [function]
unit-length
Used by
- [function]
convert
Links
Author
Hugo Giraudel
strip-units
@function strip-units($num) { ... }
View sourceDescription
Removes the unit (e.g. px, em, rem) from a value, returning the number only.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$num | Number to strip unit from. | Number | —none |
Returns
Number
—The same number, sans unit.
Used by
- [function]
convert
- [mixin]
fluid-type
- [mixin]
body
- [mixin]
heading
- [mixin]
sgl-margins
Links
unit-length
@function unit-length($number, $unit) { ... }
View sourceDescription
CASTING A STRING TO A NUMBER
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$number | —none | Number | —none |
$unit | —none | Number | —none |
Used by
- [function]
number
Links
Author
Hugo Giraudel
[private] containsModifier
@function containsModifier($selector) { ... }
View sourceDescription
判断$selector
中是否包含BEM中Modify
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | —none | String | —none |
Returns
Boolean
—true
or false
Requires
- [function]
selectorToString
Used by
- [mixin]
e
[private] selectorToString
@function selectorToString($selector) { ... }
View sourceDescription
将$selector
转换成String
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | —none | String | —none |
Returns
String
—$selector
Used by
- [function]
containsModifier
- [function]
getBlock
[private] getBlock
@function getBlock($selector) { ... }
View sourceParameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | —none | String | —none |
Returns
String
Requires
- [function]
selectorToString
Used by
- [mixin]
e
ae-str-replace
@function ae-str-replace($string, $search, $replace) { ... }
View sourceDescription
Replace $search
with $replace
in $string
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$string | Initial string | String | —none |
$search | Substring to replace | String | —none |
$replace | ('') - New value | String | —none |
Returns
String
—Updated string
Used by
- [function]
ae-svg-encode
Links
Author
Hugo Giraudel
ae-svg-encode
@function ae-svg-encode($string) { ... }
View sourceDescription
Encode SVG to use as background
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$string | —none | String | —none |
Returns
String
—Encoded svg data
Requires
- [function]
ae-str-replace
Used by
- [mixin]
angled-edge
[private] -plumber-get-default
@function -plumber-get-default() { ... }
View sourceDescription
Get a default value
Parameters
None.
Used by
- [mixin]
plumber-box
- [mixin]
plumber
[private] -plumber-is-integer
@function -plumber-is-integer() { ... }
View sourceDescription
Check if a value is a non-negative integer
Parameters
None.
Used by
- [mixin]
plumber-box
- [mixin]
plumber
[private] -plumber-round
@function -plumber-round() { ... }
View sourceDescription
Round value to the nearest quarter pixel This provides reasonable precision and prevents grid creep (by fractions adding up) in most browsers
Parameters
None.
Used by
- [mixin]
plumber
[private] _last-simple-selector
@function _last-simple-selector($selector) { ... }
View sourceDescription
Find the last simple selector in a given selector
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector | A single selector | List or String | —none |
Returns
String
—The last simple selector in $selector
Example
$result: _last-simple-selector(ul > li); // li
Throws
#{$selector}
contains #{length($parsed)} selectors and the_last-simple-selector()
function accepts only 1.
Used by
- [function]
_build-quantity-selector
[private] _build-quantity-selector
@function _build-quantity-selector($selector-append, $last-selector) { ... }
View sourceDescription
Builds the selector for the quantity query
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$selector-append | The selector to be appended | String | —none |
$last-selector | The item's selector | String | —none |
Returns
List
—The final quantity query selector
Requires
- [function]
_last-simple-selector
Used by
get-tilted-height
@function get-tilted-height($angle) { ... }
View sourceDescription
Computes the height of the tilted pseudo-element based on the given angle using Pythagoras Theorem.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$angle | the tilt angle | Angle | —none |
Used by
- [mixin]
tilted
Author
Hugo Giraudel
variables
elementSeparator
$elementSeparator: '__';
View sourceDescription
BEM
Used by
- [mixin]
e
Links
Author
Marcmintel
mixins
b
@mixin b($block) { ... }
View sourceParameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$block | BEM中的Block | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
@include b(block) {
background: red;
@include e(header){
font-size: 14px;
@include m(css) {
font-size: 18px;
}
};
}
//CSS
.block {
background: red;
}
.block__header {
font-size: 14px;
}
.block__header--css {
font-size: 18px;
}
e
@mixin e($element) { ... }
View sourceParameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$element | BEM中的Element | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
@include b(block) {
background: red;
@include e(header){
font-size: 14px;
@include m(css) {
font-size: 18px;
}
};
}
//CSS
.block {
background: red;
}
.block__header {
font-size: 14px;
}
.block__header--css {
font-size: 18px;
}
Requires
- [function]
containsModifier
- [function]
getBlock
- [variable]
elementSeparator
m
@mixin m($element) { ... }
View sourceParameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$element | BEM中的Modify | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
@include b(block) {
background: red;
@include e(header){
font-size: 14px;
@include m(css) {
font-size: 18px;
}
};
}
//CSS
.block {
background: red;
}
.block__header {
font-size: 14px;
}
.block__header--css {
font-size: 18px;
}
alert-variant
@mixin alert-variant($background, $border, $text-color) { ... }
View sourceDescription
弹出框
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$background | 背景颜色 | Type | —none |
$border | 边框 | Type | —none |
$text-color | 文本颜色 | Type | —none |
Example
//SCSS
.alert{
@include alert-variant(#f36,darken(#f36,5%),#333);
}
//CSS
.alert {
background-color: #ff3366;
border-color: #ff1a53;
color: #333333;
}
.alert a {
color: #1a1a1a;
}
Links
Author
Bootstrap
am
@mixin am($module, $trait: null) { ... }
View sourceDescription
AMCSS,实现自定义属性的属性选择器,其前缀采用了am字符开头
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$module | 自定义属性名 | Type | —none |
$trait | 属性值 | Type | null |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
@include am(module) {
color: red;
}
@include am(module, blue) {
color: blue;
}
@include am(module, large) {
font-size: 2em;
}
//CSS
[am-module] {
color: red;
}
[am-module~="blue"] {
color: blue;
}
[am-module~="large"] {
font-size: 2em;
}
Links
Author
AMCSS
ae-pseudo
@mixin ae-pseudo($location, $height) { ... }
View sourceDescription
Outputs pseudo content for main mixin
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$location | —none | String | —none |
$height | —none | Number | —none |
Output
psuedo content
Used by
- [mixin]
angled-edge
Author
Joseph Fusco
angled-edge
@mixin angled-edge($location, $hypotenuse, $fill, $width, $height) { ... }
View sourceDescription
Attatches an svg wedge shape to an element
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$location | 'inside top', 'outside top', 'inside bottom', 'outside bottom' | String | —none |
$hypotenuse | 'upper left', 'upper right', 'lower left', 'lower right' | String | —none |
$fill | —none | Color | —none |
$width | —none | Number | —none |
$height | —none | Number | —none |
Output
'::before' and/or '::after' with svg background image
Throws
Invalid argument for $location - must use:
inside top
,outside top
,inside bottom
,outside bottom
Invalid argument for $hypotenuse - must use:
upper left
,upper right
,lower left
,lower right
Requires
- [mixin]
ae-pseudo
- [function]
ae-svg-encode
Author
Joseph Fusco
animation
@mixin animation($options, $name: unique-id(), $duration: 1, $waitTime: 0, $timingFunction: linear, $iterationCount: infinite) { ... }
View sourceDescription
CSS Animation设置
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$options | —none | Map | —none |
$name | 随机生成的animation-name | String | unique-id() |
$duration | animation-duration | Number | 1 |
$waitTime | animation-delay | Number | 0 |
$timingFunction | animation-timing-function | String | linear |
$iterationCount | animation-iteration-count | String or Number | infinite |
Example
//SCSS
.anime {
@include animation(
(
animationName: zoom,
keyframes: (
0: (
transform: scale(1),
background-color: blue
),
100: (
transform: scale(3),
background-color: red
)
),
duration: 2,
waitTime: 1,
timingFunction: ease,
iterationCount: infinite
)
);
}
//CSS
.anime {
animation: zoom 2s ease 1s infinite;
}
@keyframes zoom {
0% {
transform: scale(1);
background-color: blue;
}
66.66666667% {
transform: scale(3);
background-color: red;
}
100% {
transform: scale(3);
background-color: red;
}
}
Links
Author
大漠
box-center
@mixin box-center($justify: center, $align: center) { ... }
View sourceDescription
元素垂直水平居中
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$justify | 水平对齐方向,[false] 水平方向不设置 | [string] | center |
$align | 垂直对齐方向,[false] 垂直方向不设置 | [string] | center |
Example
//SCSS
.justify-center {
@include box-center;
}
//CSS
.justify-cnter {
display: flex;
justify-content: center;
align-items: center;
}
Author
大漠
center-translate
@mixin center-translate($direction: both) { ... }
View sourceDescription
使用translate实现水平垂直居中
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$direction | 水平垂直,其它值 | String | both |
Example
//SCSS
.center{
@include center-translate;
}
//CSS
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%, -50%, 0);
}
ellipsis
@mixin ellipsis($lines: 1, $substract: 0) { ... }
View sourceDescription
控制文字行数溢出点点点
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$lines | 默认一行对于点点点结束 | Number | 1 |
$substract | 默认宽度为100% - 0 | Number | 0 |
Example
//SCSS
div {
@include box-clamp;
}
.box {
@include box-clamp(3);
}
//CSS
div {
overflow: hidden;
display: -webkit-box;
display: box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
box-orient: vertical;
}
.box {
overflow: hidden;
display: -webkit-box;
display: box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
box-orient: vertical;
}
burger
@mixin burger($width: 30px, $height: 5px, $gutter: 3px, $color: #000, $border-radius: 0, $transition-duration: 0) { ... }
View sourceDescription
Burger
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$width | 宽度 | Number | 30px |
$height | 高度 | Number | 5px |
$gutter | 间距 | Number | 3px |
$color | 线条颜色 | String | #000 |
$border-radius | 圆角 | Number | 0 |
$transition-duration | 动效持续时间 | Number | 0 |
Example
//SCSS
.burger {
@include burger;
}
//Output CSS
.burger {
position: relative;
margin-top: 8px;
margin-bottom: 8px;
user-select: none;
}
.burger, .burger::before, .burger::after {
display: block;
width: 30px;
height: 5px;
background-color: #000;
outline: 1px solid transparent;
transition-property: background-color, transform;
transition-duration: 0.3s;
}
.burger::before, .burger::after {
position: absolute;
content: "";
}
.burger::before {
top: -8px;
}
.burger::after {
top: 8px;
}
Author
Joren Van Hee
burger-parts
@mixin burger-parts() { ... }
View sourceDescription
Select parts of the burger
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.burger {
@include burger-top {
background-color: red;
}
}
//Output CSS
.burger,
.burger::before,
.burger::after {
background-color: red;
}
burger-top
@mixin burger-top() { ... }
View sourceParameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.burger {
@include burger-top {
background-color: red;
}
}
//Output CSS
.burger::before {
background-color: red;
}
burger-middle
@mixin burger-middle() { ... }
View sourceParameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.burger {
@include burger-middle {
background-color: red;
}
}
//Output CSS
.burger {
background-color: red;
}
burger-bottom
@mixin burger-bottom() { ... }
View sourceParameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.burger {
@include burger-bottom {
background-color: red;
}
}
//Output CSS
.burger::after {
background-color: red;
}
burger-to-cross
@mixin burger-to-cross($color) { ... }
View sourceDescription
Burger animations
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$color | auto | String | —none |
button-size
@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { ... }
View sourceDescription
Button Sizes
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$padding-vertical | 垂直方向的 | Number | —none |
$padding-horizontal | 水平方向的 | Number | —none |
$font-size | 字号 | Number | —none |
$line-height | 行高 | Number | —none |
$border-radius | 圆角 | Number | —none |
Example
//SCSS
.btn{
@include button-size(5px,15px,16px,1.5,null);
}
//CSS
.btn {
padding: 5px 15px;
line-height: 1.5;
}
button-variant
@mixin button-variant($color, $background, $border-color) { ... }
View sourceDescription
Button variants
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$color | 文本颜色 | String | —none |
$background | 背景颜色 | String | —none |
$border-color | 边框颜色 | String | —none |
Example
//SCSS
.btn {
@include button-variant(#fff,#f36,#f36);
}
//CSS
.btn {
color: #fff;
background-color: #f36;
border-color: #f36;
transition: all .2s ease;
}
.btn:hover,
.btn:focus,
.btn:active {
color: #fff;
background-color: #ff245b;
border-color: #ff1a53;
}
.btn[disabled],
.btn[disabled]:hover,
.btn[disabled]:focus,
.btn[disabled]:active,
fieldset[disabled] .btn,
fieldset[disabled] .btn:hover,
fieldset[disabled] .btn:focus,
fieldset[disabled] .btn:active {
background-color: #f36;
border-color: #f36;
}
calc
@mixin calc($prop, $val) { ... }
View sourceDescription
Calc计算
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$prop | CSS属性 | String | —none |
$val | CSS属性值的表达式 | String | —none |
Example
//SCSS
.calc{
@include calc(width,'100% - 20px');
}
//CSS
.calc {
width: calc(100% - 20px);
}
caret
@mixin caret($position, $caret-width, $border-width, $direction, $border-color, $background-color) { ... }
View sourceDescription
绘制三角形
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$position | —none | String | —none |
$caret-width | 三角形外宽度 | Number | —none |
$border-width | 三角形内宽度 | Number | —none |
$direction | 三角形方向 | String | —none |
$border-color | 边框颜色 | String | —none |
$background-color | 背景颜色 | String | —none |
Example
//SCSS
.caret{
@include caret(absolute,50px,1px,bottom,red,#ccc);
}
//CSS
.caret {
position: absolute;
}
.caret:before, .caret:after {
content: "";
`position: absolute;
}
.caret:before {
top: 0;
left: 0;
border-top: 50px solid red;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
.caret:after {
left: 1px;
top: 0;
border-top: 49px solid #ccc;
border-left: 49px solid transparent;
border-right: 49px solid transparent;
}
Links
corners
@mixin corners($shorthand) { ... }
View sourceDescription
CSS Corners
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$shorthand | —none | List | —none |
Example
//SCSS
$shortand:40px 20px solid red;
.corners {
@include corners($shortand);
}
//OutPut CSS
.corners {
border: 20px solid red;
clip-path: polygon(0 40px, 0 0, 40px 0, 40px 21px, calc(100% - 40px) 21px, calc(100% - 40px) 0, 100% 0, 100% 40px, calc(100% - #bw - 1px) 40px, calc(100% - #bw - 1px) calc(100% - 40px), 100% calc(100% - 40px), 100% 100%, calc(100% - 40px) 100%, calc(100% - 40px) calc(100% - #bw - 1px), 40px calc(100% - #bw - 1px), 40px 100%, 0 100%, 0 calc(100% - 40px), 21px calc(100% - 40px), 21px 40px);
}
Links
Author
Bennett Feely
equal-parts
@mixin equal-parts($type: table, $children: li) { ... }
View sourceParameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$type | 模拟table等分 [flex] - 使用flexbox布局等 [other] - 不编译 | String | table |
$children | 默认值为li [other] - 可以取div,p,a,span,strong | $string | li |
fadeText
@mixin fadeText($text-color, $direction: top, $offset: 2em, $transition: 0.5s ease-out) { ... }
View sourceDescription
Fade Text
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$text-color | text color | String | —none |
$direction | Fade Direction | String | top |
$offset | Fade Offset | String | 2em |
$transition | Transition Effects | String | 0.5s ease-out |
Example
//SCSS
p {
color: #fff;
@supports(mix-blend-mode: screen){
@include fadeText(light, top, 3rem);
}
}
//Output CSS
p {
color: #fff;
}
Links
Author
Giana
grid
@mixin grid($display: flex, $flex-direction: null, $flex-wrap: null, $flex-flow: null, $justify-content: null, $align-items: null, $align-content: null, $gutter: null, $grid-type: skeleton) { ... }
View sourceDescription
Define the grid container
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$display | 生成一个block-level或者inline-level网格容器:[flex|inline-flex] | String | flex |
$flex-direction | 指定伸缩容器主轴的伸缩流方向:[row|row-reverse|column|column-reverse] | String | null |
$flex-wrap | 指定伸缩项目是否沿着侧轴排列:[nowrap|wrap|wrap-reverse] | String | null |
$flex-flow | 适用于flex容器元素,flex-direction和flex-wrap的缩写属性: [row|row-reverse|column|column-reverse] [nowrap|wrap|wrap-reverse] | String | null |
$justify-content | 指定伸缩项目沿主轴对齐方式:[flex-start|flex-end|center|space-betwwen|space-around] | String | null |
$align-items | 指定伸缩项目沿着侧轴对齐方式:[flex-start|flex-end|center|stretch] | String | null |
$align-content | 指定伸缩项目行在侧轴的对齐方式:[flex-start|flex-end|center|space-between|space-around|stretch] | String | null |
$gutter | 网格左右两端有 | String | null |
$grid-type | 网格类型:[skeleton|margin-offset] | String | skeleton |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
grid-gutter
grid-gutter
@mixin grid-gutter($margin: null, $margin-top: null, $margin-right: null, $margin-bottom: null, $margin-left: null) { ... }
View sourceDescription
Generate the margins around grids.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$margin | 设置margin值:[null| | String | null |
$margin-top | 设置margin-top值:[null| | String | null |
$margin-right | 设置margin-rgiht值:[null| | String | null |
$margin-bottom | 设置margin-bottom值:[null| | String | null |
$margin-left | 设置margin-left值:[null| | String | null |
Used by
grid-col
@mixin grid-col($col: null, $grid-columns: 12, $col-offset: null, $gutter: null, $condensed: false, $align-self: null, $flex-grow: 0, $flex-shrink: 1, $flex-basis: auto, $order: null, $grid-type: skeleton, $last-child: false) { ... }
View sourceDescription
Generate the grid columns
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$col | 网格列数:[null|initial| | Number | null |
$grid-columns | 网格总列数 | Number | 12 |
$col-offset | 抵消列宽度:[null| | String | null |
$gutter | 列间距:[null| | String | null |
$condensed | 去掉列顶部和底部的margin | Boolean | false |
$align-self | 单个伸缩项目侧轴对齐方式:[null|auto|flex-start|flex-end|center|baseline|stretch] | String | null |
$flex-grow | Flex项目的扩大比例 | Number | 0 |
$flex-shrink | 定义Flex项目的缩小比例 | Number | 1 |
$flex-basis | Flex项目在分配Flex容器剩余空间之前的一个默认尺寸:[ | Number | auto |
$order | 控制Flex项目的顺序源 | Number | null |
$grid-type | 网格类型:[skeleton|margin-offset] | String | skeleton |
$last-child | 当网格类型是margin-offset时,调整最后一列margin值 | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
grid-gutter
fluid-ratio
@mixin fluid-ratio($large-size, $small-size) { ... }
View sourceDescription
Fluid aspect rations for RWD background images
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$large-size | 大的背景图片尺寸 | List | —none |
$small-size | 小的背景图片尺寸 | List | —none |
Example
//SCSS
.fluid-ratio{
@include fluid-ratio(800 400,300 150);
}
//Out CSS
.fluid-ratio {
padding-top: 50%;
height: 0;
background-size: cover;
background-position: center;
}
Links
full-width
@mixin full-width($support-type: margin, $min-width: null) { ... }
View sourceDescription
Full Width Containers in Limited Width Parents
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$support-type | 有三个可选值 | String | margin |
$min-width | 父容器最小宽度 | Number | null |
Example
//SCSS
.full-width {
@include full-width(margin, 960px);
}
//CSS
.full-width {
margin-left: calc(-50vw + 50%);
margin-right: calc(-50vw + 50%);
}
geometric-size
@mixin geometric-size($width, $height, $base: 0) { ... }
View sourceDescription
Geometric size
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$width | 容器的 | Number | —none |
$height | 容器的 | Number | —none |
$base | —none | Number | 0 |
heightRelativeToWidth
@mixin heightRelativeToWidth($percentage: 100%, $pos: after) { ... }
View sourceDescription
容器高度相对于宽度的计算
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$percentage | 高度和宽度一样 | Number | 100% |
$pos | 通过伪元元素 | String | after |
Content
This mixin allows extra content to be passed (through the @content
directive).
haslines
@mixin haslines($gutter: 20px, $color: #ccc, $minWidth: 20px, $height: 1px) { ... }
View sourceDescription
Has Lines
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$gutter | 间距 | Number | 20px |
$color | 线条颜色 | String | #ccc |
$minWidth | 线条宽度 | Number | 20px |
$height | 线条粗细 | Number | 1px |
mq
@mixin mq($args...) { ... }
View sourceDescription
Sass Media Queries
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$args... | —none | List | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Used by
- [mixin]
screen
- [mixin]
max-screen
- [mixin]
min-screen
- [mixin]
screen-height
- [mixin]
max-screen-height
- [mixin]
min-screen-height
- [mixin]
hdtv
- [mixin]
iphone4
- [mixin]
iphone5
- [mixin]
iphone6
- [mixin]
iphone6-plus
- [mixin]
ipad
- [mixin]
ipad-retina
- [mixin]
landscape
- [mixin]
portrait
Links
Author
Rafal Bromirski
screen
@mixin screen($min, $max, $orientation: false) { ... }
View sourceDescription
Media Queries for screen
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$min | —none | String | —none |
$max | —none | String | —none |
$orientation | —none | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
max-screen
@mixin max-screen($max) { ... }
View sourceDescription
Media Queries for max screen
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$max | —none | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
min-screen
@mixin min-screen($min) { ... }
View sourceDescription
Media Queries for min screen
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$min | —none | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
screen-height
@mixin screen-height($min, $max, $orientation: false) { ... }
View sourceDescription
Media Queries for screen height
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$min | —none | String | —none |
$max | —none | String | —none |
$orientation | —none | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
max-screen-height
@mixin max-screen-height($max) { ... }
View sourceDescription
Media Queries for max screen height
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$max | —none | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
min-screen-height
@mixin min-screen-height($min) { ... }
View sourceDescription
Media Queries for min screen height
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$min | —none | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
hdpi
@mixin hdpi($ratio: 1.3) { ... }
View sourceDescription
Media Queries for hdpi
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$ratio | —none | Number | 1.3 |
Content
This mixin allows extra content to be passed (through the @content
directive).
hdtv
@mixin hdtv($standard: 1080) { ... }
View sourceDescription
Media Queries for hdtv
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$standard | —none | Number | 1080 |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
iphone4
@mixin iphone4($orientation: false) { ... }
View sourceDescription
Media Queries for iPhone4
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$orientation | —none | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
iphone5
@mixin iphone5($orientation: false) { ... }
View sourceDescription
Media Queries for iPhone5
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$orientation | —none | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
iphone6
@mixin iphone6($orientation: false) { ... }
View sourceDescription
Media Queries for iPhone6
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$orientation | —none | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
iphone6-plus
@mixin iphone6-plus($orientation: false) { ... }
View sourceDescription
Media Queries for iPhone6 Plus
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$orientation | —none | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
ipad
@mixin ipad($orientation: false) { ... }
View sourceDescription
Media Queries for iPad All
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$orientation | —none | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
ipad-retina
@mixin ipad-retina($orientation: false) { ... }
View sourceDescription
Media Queries for iPad (Retina)
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$orientation | —none | Boolean | false |
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
landscape
@mixin landscape() { ... }
View sourceDescription
Media Queries for orientation
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
portrait
@mixin portrait() { ... }
View sourceDescription
Media Queries for portrait
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Requires
- [mixin]
mq
media-queries
@mixin media-queries($qtype) { ... }
View sourceDescription
Media queries with Sass Maps
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$qtype | —none | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
palette-town
@mixin palette-town($color, $type) { ... }
View sourceDescription
Try changing the $test-color variable in the CSS area and watch a new color palette generate!
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$color | —none | List | —none |
$type | —none | String | —none |
Links
Author
jordiesaenz
plumber-box
@mixin plumber-box($grid-height: null, $margin: 0 0, $border: 0px 0px, $padding: 0) { ... }
View sourceDescription
Plumber extension to align boxes to the baseline grid
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$grid-height | Override the default grid height (Any unit | As set in Plumber) | Number | null |
$margin | Top and bottom margin as a multiple of grid height (One two integers) | Number | 0 0 |
$border | Top and bottom border width (One or two non-negative px values or 0s) | String | 0px 0px |
$padding | Top and bottom padding as a multiple of grid height (One or two non-negative integers) | Number | 0 |
Example
//SCSS
blockquote {
@include plumber-box(
$margin: 2 0, // top margin: 2, bottom margin: 0
$padding: 1 1 // top padding: 1, bottom padding: 1
);
}
//Oupt CSS
blockquote {
margin-top: 2rem;
padding-top: 1rem;
margin-bottom: 0;
padding-bottom: 1rem;
}
Throws
Plumber-box depends on plumber-sass. Please install and include plumber-sass first
$grid-height must be passed as a parameter or defined with -plumber-set-defaults
$grid-height parameter must be a positive unit, got #{$grid-height} instead
$margin values must be integers, got #{$value} instead
$border values must be non-negative pixels, got #{$value} instead
$padding values must be non-negative integers, got #{$value} instead
Cannot use borders with 0 padding
Requires
- [function]
-plumber-get-default
- [function]
-plumber-is-integer
Links
Author
jamonserrano:https://github.com/jamonserrano
plumber
@mixin plumber($baseline: null, $font-size: null, $grid-height: null, $leading-top: null, $leading-bottom: null, $line-height: null, $use-baseline-origin: null) { ... }
View sourceDescription
Create better looking documents and speed up CSS development by adding vertical rhythm to your page.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$baseline | Baseline ratio (Fraction between 0 and 1) | Number | null |
$font-size | Font size as a fraction of grid height (Positive number) | Number | null |
$grid-height | Grid height (Any unit) | String | null |
$leading-top | Top leading* as a multiple of grid height (Integer) | Number | null |
$leading-bottom | Bottom leading* as a multiple of grid height (Integer) | Number | null |
$line-height | Line height as a multiple of grid height (Positive integer) | Number | null |
$use-baseline-origin | Set the origin of leadings to the baseline | Boolean | null |
Example
//SCSS
p {
@include plumber(
$grid-height: 1rem,
$baseline: 0.158203,
$font-size: 1.75,
$line-height: 3,
$leading-top: 1,
$leading-bottom: 2
);
font-family: Roboto, sans-serif;
}
Output CSS
p {
font-size: 1.75rem;
line-height: 3rem;
margin-top: 0;
padding-top: 0.81641rem;
padding-bottom: 0.18359rem;
margin-bottom: 2rem;
font-family: Roboto, sans-serif;
}
Throws
$font-size parameter must be a positive unitless number, got #{$font-size} instead
$line-height parameter must be a positive unitless integer, got #{$line-height} instead
$leading-top parameter must be a non-negative integer, got #{$leading-top} instead.
$leading-bottom parameter must be a non-negative integer, got #{$leading-bottom} instead
$grid-height parameter must be a positive unit, got #{$grid-height} instead
$baseline must be passed as a parameter or defined in defaults
$baseline parameter must be a unitless fraction between 0 and 1, got #{$baseline} instead
$use-baseline-origin parameter must be Boolean, got #{$use-baseline-origin} instead
Requires
- [function]
-plumber-get-default
- [function]
-plumber-is-integer
- [function]
-plumber-round
Links
Author
jamonserrano:https://github.com/jamonserrano
plumber-set-defaults
@mixin plumber-set-defaults() { ... }
View sourceDescription
Merge provided settings into the defaults map
Parameters
None.
border-polygon
@mixin border-polygon($num, $color: #000, $radius: 64px) { ... }
View sourceDescription
Border Polygon
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$num | 多边型数量 | Number | —none |
$color | 多边型颜色 | String | #000 |
$radius | 多边型背景 | Number | 64px |
Links
Author
大漠
clip-polygon
@mixin clip-polygon($num, $color, $radius) { ... }
View sourceDescription
使用 clip 制作多边形
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$num | 多边形数量 | Number | —none |
$color | 多边形颜色 | String | —none |
$radius | 多边形半径 | Number | —none |
Links
Author
大漠
position
@mixin position($position, $args) { ... }
View sourceDescription
设置position
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$position | 可选值: | String | —none |
$args | 可设置值: | String | —none |
Example
//SCSS
.absolute{
@include position(absolute,top 10px right 20px);
}
.absolute{
@include position(absolute,top 0 right 0 bottom 0 left 0);
}
//Output CSS
.absolute {
top: 10px;
right: 20px;
position: absolute;
}
.absolute {
top: 0;
right: 0;
bottom: 0;
left: 0;
position: absolute;
}
Links
Author
大漠
scrollbars
@mixin scrollbars($size, $foreground-color, $background-color: mix($foreground-color, white, 50%)) { ... }
View sourceDescription
Mixin to customize scrollbars Beware, this does not work in all browsers
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$size | Horizontal scrollbar's height and vertical scrollbar's width | Length | —none |
$foreground-color | Scrollbar's color | Color | —none |
$background-color | Scrollbar's color | Color | mix($foreground-color, white, 50%) |
Example
Scrollbar styling
@include scrollbars(.5em, slategray);
Author
Hugo Giraudel
context
@mixin context($old-context, $new-context) { ... }
View sourceParameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$old-context | 选择器 | String | —none |
$new-context | 选择器 | String | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.tabs {
.tab {
background: red;
&:hover {
background: white;
}
.tab-link {
color: white;
@include context('.tab', '.tab:hover') {
color: red;
}
}
}
}
//CSS
.tabs .tab {
background: red;
}
.tabs .tab:hover {
background: white;
}
.tabs .tab .tab-link {
color: white;
}
.tabs .tab:hover .tab-link {
color: red;
}
Links
parentState
@mixin parentState($states) { ... }
View sourceParameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$states | 选择器组 | List | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.tab {
background: red;
&:hover {
background: white;
}
.tab-link {
color: white;
@include parentState(':hover', '.active') {
color: pink;
}
}
}
//CSS
.tab {
background: red;
}
.tab:hover {
background: white;
}
.tab .tab-link {
color: white;
}
.tab:hover .tab-link {
color: pink;
}
.tab.active .tab-link {
color: pink;
}
pseudo-elements
@mixin pseudo-elements($el, $el-width, $el-height) { ... }
View sourceDescription
伪元素
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$el | 伪元素 | String | —none |
$el-width | 伪元素的 | Number | —none |
$el-height | 伪元素的 | Number | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.icon-toggle {
width: 1.56em;
height: 0.75em;
position: relative;
display: inline-block;
border-top: solid .125em #60666c;
@include pseudo-elements(before, 1.56em, .125em) {
background: #888c91;
top: .25em;
}
@include pseudo-elements(after, 1.56em, .125em) {
background: #afb3b5;
bottom: 0;
}
}
// Out CSS
.icon-toggle {
width: 1.56em;
height: 0.75em;
position: relative;
display: inline-block;
border-top: solid .125em #60666c;
}
.icon-toggle:before {
content: "";
position: absolute;
width: 1.56em;
height: 0.125em;
background: #888c91;
top: .25em;
}
.icon-toggle:after {
content: "";
position: absolute;
width: 1.56em;
height: 0.125em;
background: #afb3b5;
bottom: 0;
}
Links
Author
Guil Hernandez
parent-hover
@mixin parent-hover() { ... }
View sourceDescription
Parent Hover
Parameters
None.
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.nav-menu {
li {
float: left;
a {
color: blue;
@include parent-hover {
color: purple;
}
}
.sub-menu {
display: none;
@include parent-hover {
display: block;
}
}
}
}
//Out CSS
.nav-menu li {
float: left;
}
.nav-menu li a {
color: blue;
}
.nav-menu li:hover a {
color: purple;
}
.nav-menu li .sub-menu {
display: none;
}
.nav-menu li:hover .sub-menu {
display: block;
}
Links
parent-nth-status
@mixin parent-nth-status($index, $status, $place: prefix/suffix/prepend/append) { ... }
View sourceDescription
parent-nth-status($index, $status, $place: suffix)
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$index | —none | Number | —none |
$status | —none | String | —none |
$place | —none | String | prefix/suffix/prepend/append |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.a .b, .a .c {
@include parent-nth-status(1, ':hover', suffix) {
color: red;
}
@include parent-nth-status(1, '.en', prepend) {
color: green;
}
@include parent-nth-status(-2, '.target', append) {
colore: blue;
}
}
// Out CSS
.a:hover .b, .a:hover .c {
color: red;
}
.en .a .b, .en .a .c {
color: green;
}
.a .target .b, .a .target .c {
color: blue;
}
Throws
#{$func-name} should not at root!
#{$func-name} parameter $status error
Used by
- [mixin]
parent-status
parent-status
@mixin parent-status($status, $place: prefix/suffix/prepend/append) { ... }
View sourceDescription
Parent Status
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$status | —none | String | —none |
$place | —none | String | prefix/suffix/prepend/append |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
.tab {
a {
display: inline-block;
padding: 10px 60px;
cursor: pointer;
&:hover {
background: #AAA;
}
i {
margin-left: 10px;
@include parent-status(':hover') { color: red; }
@include parent-status('.home-link') { background: blue; }
@include parent-status('.about-link') { background: green; }
}
}
}
// Out CSS
.tab a {
display: inline-block;
padding: 10px 60px;
cursor: pointer;
}
.tab a:hover {
background: #AAA;
}
.tab a i {
margin-left: 10px;
}
.tab a:hover i {
color: red;
}
.tab a.home-link i {
background: blue;
}
.tab a.about-link i {
background: green;
}
Requires
- [mixin]
parent-nth-status
at-least
@mixin at-least($count) { ... }
View sourceDescription
Query when total items is at least N items
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$count | Quantity to match (equal or more) | Number | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Make the items color red when there are 4 items or more
ul li {
@include at-least(4) { color: red; }
}
Make the items color blue when there are 6 items or more and use '*' (element agnostic) as the item selector
ul li {
@include at-least(6, '*') { color: blue; }
}
Throws
#{$count}
is not a valid number forat-least
#{$selector}
is not a valid selector forat-least
Requires
- [function]
_build-quantity-selector
at-most
@mixin at-most($count) { ... }
View sourceDescription
Query when total items is at most N items
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$count | Quantity to match (equal or less) | Number | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Make the items color red when there are 4 items or less
ul li {
@include at-most(4) { color: red; }
}
Make the items color blue when there are 6 items or less and use '*' (element agnostic) as the item selector
ul li {
@include at-most(6, '*') { color: blue; }
}
Throws
#{$count}
is not a valid number forat-most
.#{$selector}
is not a valid selector forat-most
Requires
- [function]
_build-quantity-selector
between
@mixin between($at-least, $at-most) { ... }
View sourceDescription
Query when total items is at least X items and at most Y items
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$at-least | Lower quantity of items to match | Number | —none |
$at-most | Higher quantity of items to match | Number | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Make the items color red when there are at least 2 and at most 4 items
ul li {
@include between(4, 8) { color: red; }
}
Make the items color blue when there are at least 6 items and at most 10 items and use '*' (element agnostic) as the item selector
ul li {
@include between(6, 10, '*') { color: blue; }
}
Throws
#{$first}
is not a valid number forbetween
#{$last}
is not a valid number forbetween
#{$first} can´t be larger that #{$last} for
between
#{$selector}
is not a valid selector forbetween
Requires
- [function]
_build-quantity-selector
exactly
@mixin exactly($count) { ... }
View sourceDescription
Query when total items is exactly N items
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$count | Quantity to match (equal) | Number | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
Make the items color red when there are exactly 4 items
ul li {
@include exactly(4) { color: red; }
}
Make the items color blue when there are exactly 6 items and use '*' (element agnostic) as the item selector
ul li {
@include exactly(6, '*') { color: blue; }
}
Throws
#{$count}
is not a valid number forexactly
#{$selector}
is not a valid selector forexactly
Requires
- [function]
_build-quantity-selector
select-range
@mixin select-range($start, $end) { ... }
View sourceDescription
range selector mixin
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$start | 开始值 | Number | —none |
$end | 结束值 | Number | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
li {
@include select-range(3,5){
color: red;
}
}
//Output CSS
li:nth-child(n+3):nth-child(-n+5) {
color: red;
}
mod-list
@mixin mod-list($mod, $remainder) { ... }
View sourceDescription
mod query mixin
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$mod | 整除倍数 | Number | —none |
$remainder | 余数 | Number | —none |
Content
This mixin allows extra content to be passed (through the @content
directive).
Example
//SCSS
li{
@include mod-list(3,1){
color: green;
}
}
//Output CSS
li:nth-last-child(3n+1):first-child,
li:nth-last-child(3n+1):first-child ~ li {
color: green;
}
dimensions
@mixin dimensions($width: null, $height: $width) { ... }
View sourceDescription
Set Dimensions
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$width | 宽度 | Number | null |
$height | 高度 | Number | $width |
Example
//SCSS
.box {
@include dimensions(100px,200px);
}
//Output CSS
.box {
width: 100px;
height: 200px;
}
Used by
- [mixin]
spriteSpirit
Author
Eliorshalev
spriteSpirit
@mixin spriteSpirit($name, $url, $vertical, $width, $hieght, $frameNum, $duration: .8, $iteration: 0, $reverse: false) { ... }
View sourceDescription
Sprite to Animate Mixin
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$name | 动画名称 | String | —none |
$url | Sprite图路径 | String | —none |
$vertical | Sprite图是不是垂直排列 | Boolean | —none |
$width | Sprite图宽度 | Number | —none |
$hieght | Spritel图高度 | Number | —none |
$frameNum | 动画帧数 | String | —none |
$duration | 动画播放持续时间 | Number | .8 |
$iteration | 动画播放次数 | Number | 0 |
$reverse | 动画是不是反向播放 | Boolean | false |
Example
//SCSS
.spriteAnimate {
@include spriteSpirit(
'sprite',
'//www.w3cplus.com/img/srpite.png',
false,
800px,
100px,
8,
1s
)
}
Requires
- [mixin]
dimensions
Links
Author
Eliorshalev
tilted
@mixin tilted($angle, $color, $position: 'top', $pseudo: 'before') { ... }
View sourceDescription
Apply a tilted effect by generating a pseudo-element with a diagonal splitted background.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$angle | the tilt angle | Angle | —none |
$color | the color to be used as background + gradient | Color | —none |
$position | either | String | 'top' |
$pseudo | either | String | 'before' |
Requires
- [function]
get-tilted-height
Author
Hugo Giraudel
fluid-type
@mixin fluid-type($properties, $min-vw, $max-vw, $min-value, $max-value) { ... }
View sourceDescription
Fluid vertical rhythm and Fluid Modular scale
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$properties | CSS属性 | String | —none |
$min-vw | 视窗最小宽度(viewport min-width) | String | —none |
$max-vw | 视窗最大宽度(viewport max-width) | String | —none |
$min-value | 最小值 | String | —none |
$max-value | 最大值 | String | —none |
Example
//SCSS
$minScreen: 20rem; // $min-vw
$maxScreen: 50rem; // $max-vw
$minFont: .8rem; // $min-value
$maxFont: 2rem; // $max-value
:root {
@include fluid-type(font-size, $minScreen, $maxScreen, $minFont, $maxFont);
}
//Output CSS
:root {
font-size: 0.8rem;
}
@media screen and (min-width: 20rem) {
:root {
font-size: calc(0.8rem + 1.2 * ((100vw - 20rem) / 30));
}
}
@media screen and (min-width: 50rem) {
:root {
font-size: 2rem;
}
}
Requires
- [function]
strip-units
body
@mixin body($font-size: 18px, $base-line-height: 1.2, $base-font-size: 16px, $unit: "px") { ... }
View sourceDescription
To use in the body
element.Outputs font-size
and line-height
.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$font-size | Base font size(Define $base-font-size) | Number | 18px |
$base-line-height | Base line-height (Define $base-line-height) | Number | 1.2 |
$base-font-size | Default font size | Number | 16px |
$unit | Unit to output (Define $base-unit) | String | "px" |
Example
body {
@include body();
}
body {
font-size: 18px;
line-height: 22px;
}
Requires
- [function]
px2rem
- [function]
decimal-ceil
- [function]
px2em
- [function]
strip-units
Links
Author
hiulit
heading
@mixin heading($step, $unit: "px", $base-value: 18px, $scale-factor: 1.618, $base-line-height: 1.2) { ... }
View sourceDescription
To use in headings <h1> - <h4>
.
Outputs font-size
, line-height
, margin-bottom
and margin-top
.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$step |
| Number | —none |
$unit | Unit to output(Defin $base-unit) | String | "px" |
$base-value | Optional call with a different base font size when using em (Define $base-font-size) | Number | 18px |
$scale-factor | Scale factor constants | Number | 1.618 |
$base-line-height | Base line-height | Number | 1.2 |
Example
h1 {
@include heading(3, "em");
}
h2 {
@include heading(2, "px");
}
h3 {
@include heading(1, "pxrem");
}
h4 {
@include heading(0);
}
h1 {
font-size: 4.22222em;
line-height: 1.15789em;
margin-bottom: 0.28947em;
margin-top: 0.57895em;
}
h2 {
font-size: 47px;
line-height: 66px;
margin-bottom: 22px;
margin-top: 44px;
}
h3 {
font-size: 29px;
line-height: 44px;
margin-bottom: 22px;
margin-top: 22px;
font-size: 1.8125rem;
line-height: 2.75rem;
margin-bottom: 1.375rem;
margin-top: 1.375rem;
}
h4 {
font-size: 18px;
line-height: 22px;
margin-bottom: 22px;
margin-top: 22px;
font-size: 1.125rem;
line-height: 1.375rem;
margin-bottom: 1.375rem;
margin-top: 1.375rem;
}
Requires
- [function]
exponent
- [function]
px2rem
- [function]
decimal-ceil
- [function]
px2em
- [function]
strip-units
sgl-margins
@mixin sgl-margins($unit: "px", $base-value: 18px, $base-line-height: 1.2) { ... }
View sourceDescription
To use in <p>
, <ul>
, <ol>
, <pre>
, <table>
, <blockquote>
, etc.
Outputs margin-bottom
and margin-top
.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$unit | Unit to output(Define $base-unit) | String | "px" |
$base-value | Optional call with a different base font size when using em (Define $base-font-size) | Number | 18px |
$base-line-height | Base line height | Number | 1.2 |
Example
p, ul, ol, pre, table, blockquote {
@include margins();
}
p, ul, ol, pre, table, blockquote {
margin-bottom: 22px;
margin-top: 22px;
}
Requires
- [function]
strip-units
- [function]
px2rem
- [function]
decimal-ceil
- [function]
px2em