General

functions

convert

@function convert($unit, $value, $base-font-size: null) { ... }
View source

Description

Converts one or more pixel values into matching rem (or em) values.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$unit

单位名称(一般是em或rem)

Stringnone
$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 Listnone
$base-font-size

The base value to use when calculating the rem. If you're using Foundation out of the box, this is 16px. If this parameter is null, the function will reference the $base-font-size variable as the base.

Numbernull

Returns

List

A list of converted values.

Requires

Used by

Links

px2rem

@function px2rem($value, $base-font-size: null) { ... }
View source

Description

Converts a unitless, pixel, or rem value to em, for use in breakpoints.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault 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 Listnone
$base-font-size

The base value to use when calculating the rem. If you're using Foundation out of the box, this is 16px. If this parameter is null, the function will reference the $base-font-size variable as the base.

Numbernull

Requires

Used by

px2em

@function px2em($value, $base-font-size: null) { ... }
View source

Description

Converts a unitless, pixel, or rem value to em, for use in breakpoints.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault 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 Listnone
$base-font-size

The base value to use when calculating the rem. If you're using Foundation out of the box, this is 16px. If this parameter is null, the function will reference the $base-font-size variable as the base.

Numbernull

Requires

Used by

decimal-round

@function decimal-round($number, $digits: 0, $mode: round) { ... }
View source

Description

Round a number to specified digits

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$number

A number to round

Numbernone
$digits

Digits to output

Number0
$mode

(round|ceil|floor) How to round a number

Stringround

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

Links

Author

  • terkel

decimal-ceil

@function decimal-ceil($number, $digits: 0) { ... }
View source

Description

Ceil a number to specified digits.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$number

A number to round

Numbernone
$digits

Digits to output

Number0

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

Used by

Links

Author

  • terkel

decimal-floor

@function decimal-floor($number, $digits: 0) { ... }
View source

Description

Floor a number to specified digits.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$number

A number to round

Numbernone
$digits

Digits to output

Number0

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

Links

Author

  • terkel

exponent

@function exponent($base, $exponent) { ... }
View source

Description

Exponent

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$basenoneNumbernone
$exponentnoneNumbernone

Used by

Links

Author

  • scottkellum

number

@function number($string) { ... }
View source

Description

将字符串转换成数字

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$stringnoneStringnone

Requires

Used by

Links

Author

  • Hugo Giraudel

strip-units

@function strip-units($num) { ... }
View source

Description

Removes the unit (e.g. px, em, rem) from a value, returning the number only.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$num

Number to strip unit from.

Numbernone

Returns

Number

The same number, sans unit.

Used by

Links

unit-length

@function unit-length($number, $unit) { ... }
View source

Description

CASTING A STRING TO A NUMBER

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$numbernoneNumbernone
$unitnoneNumbernone

Used by

Links

Author

  • Hugo Giraudel

[private] containsModifier

@function containsModifier($selector) { ... }
View source

Description

判断$selector中是否包含BEM中Modify

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selectornoneStringnone

Returns

Boolean

true or false

Requires

Used by

  • [mixin] e

[private] selectorToString

@function selectorToString($selector) { ... }
View source

Description

$selector转换成String

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selectornoneStringnone

Returns

String

$selector

Used by

[private] getBlock

@function getBlock($selector) { ... }
View source

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selectornoneStringnone

Returns

String

Requires

Used by

  • [mixin] e

ae-str-replace

@function ae-str-replace($string, $search, $replace) { ... }
View source

Description

Replace $search with $replace in $string

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$string

Initial string

Stringnone
$search

Substring to replace

Stringnone
$replace

('') - New value

Stringnone

Returns

String

Updated string

Used by

Links

Author

  • Hugo Giraudel

ae-svg-encode

@function ae-svg-encode($string) { ... }
View source

Description

Encode SVG to use as background

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$stringnoneStringnone

Returns

String

Encoded svg data

Requires

Used by

[private] -plumber-get-default

@function -plumber-get-default() { ... }
View source

Description

Get a default value

Parameters

None.

Used by

[private] -plumber-is-integer

@function -plumber-is-integer() { ... }
View source

Description

Check if a value is a non-negative integer

Parameters

None.

Used by

[private] -plumber-round

@function -plumber-round() { ... }
View source

Description

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

[private] _last-simple-selector

@function _last-simple-selector($selector) { ... }
View source

Description

Find the last simple selector in a given selector

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selector

A single selector

List or Stringnone

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

[private] _build-quantity-selector

@function _build-quantity-selector($selector-append, $last-selector) { ... }
View source

Description

Builds the selector for the quantity query

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$selector-append

The selector to be appended

Stringnone
$last-selector

The item's selector

Stringnone

Returns

List

The final quantity query selector

Requires

Used by

get-tilted-height

@function get-tilted-height($angle) { ... }
View source

Description

Computes the height of the tilted pseudo-element based on the given angle using Pythagoras Theorem.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$angle

the tilt angle

Anglenone

Used by

Author

  • Hugo Giraudel

variables

elementSeparator

$elementSeparator: '__';
View source

Description

BEM

Used by

  • [mixin] e

Links

Author

  • Marcmintel

mixins

b

@mixin b($block) { ... }
View source

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$block

BEM中的Block

Stringnone

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 source

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$element

BEM中的Element

Stringnone

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

m

@mixin m($element) { ... }
View source

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$element

BEM中的Modify

Stringnone

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 source

Description

弹出框

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$background

背景颜色

Typenone
$border

边框

Typenone
$text-color

文本颜色

Typenone

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 source

Description

AMCSS,实现自定义属性的属性选择器,其前缀采用了am字符开头

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$module

自定义属性名

Typenone
$trait

属性值

Typenull

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 source

Description

Outputs pseudo content for main mixin

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$locationnoneStringnone
$heightnoneNumbernone

Output

psuedo content

Used by

Author

  • Joseph Fusco

angled-edge

@mixin angled-edge($location, $hypotenuse, $fill, $width, $height) { ... }
View source

Description

Attatches an svg wedge shape to an element

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$location

'inside top', 'outside top', 'inside bottom', 'outside bottom'

Stringnone
$hypotenuse

'upper left', 'upper right', 'lower left', 'lower right'

Stringnone
$fillnoneColornone
$widthnoneNumbernone
$heightnoneNumbernone

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

Author

  • Joseph Fusco

animation

@mixin animation($options, $name: unique-id(), $duration: 1, $waitTime: 0, $timingFunction: linear, $iterationCount: infinite) { ... }
View source

Description

CSS Animation设置

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$optionsnoneMapnone
$name

随机生成的animation-name

Stringunique-id()
$duration

animation-duration

Number1
$waitTime

animation-delay

Number0
$timingFunction

animation-timing-function

Stringlinear
$iterationCount

animation-iteration-count

String or Numberinfinite

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 source

Description

元素垂直水平居中

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault 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 source

Description

使用translate实现水平垂直居中

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$direction

水平垂直,其它值horizontalvertical

Stringboth

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 source

Description

控制文字行数溢出点点点

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$lines

默认一行对于点点点结束

Number1
$substract

默认宽度为100% - 0

Number0

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 source

Description

Burger

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$width

宽度

Number30px
$height

高度

Number5px
$gutter

间距

Number3px
$color

线条颜色

String#000
$border-radius

圆角

Number0
$transition-duration

动效持续时间

Number0

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 source

Description

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 source

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::before {
 background-color: red;
}

burger-middle

@mixin burger-middle() { ... }
View source

Parameters

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 source

Parameters

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 source

Description

Burger animations

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$color

auto

Stringnone

button-size

@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { ... }
View source

Description

Button Sizes

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$padding-vertical

垂直方向的padding

Numbernone
$padding-horizontal

水平方向的padding

Numbernone
$font-size

字号

Numbernone
$line-height

行高

Numbernone
$border-radius

圆角

Numbernone

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 source

Description

Button variants

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$color

文本颜色

Stringnone
$background

背景颜色

Stringnone
$border-color

边框颜色

Stringnone

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 source

Description

Calc计算

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$prop

CSS属性

Stringnone
$val

CSS属性值的表达式

Stringnone

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 source

Description

绘制三角形

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$positionnoneStringnone
$caret-width

三角形外宽度

Numbernone
$border-width

三角形内宽度

Numbernone
$direction

三角形方向

Stringnone
$border-color

边框颜色

Stringnone
$background-color

背景颜色

Stringnone

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 source

Description

CSS Corners

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$shorthandnoneListnone

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 source

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$type

模拟table等分 [flex] - 使用flexbox布局等 [other] - 不编译

Stringtable
$children

默认值为li [other] - 可以取div,p,a,span,strong

$stringli

fadeText

@mixin fadeText($text-color, $direction: top, $offset: 2em, $transition: 0.5s ease-out) { ... }
View source

Description

Fade Text

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$text-color

text color

Stringnone
$direction

Fade Direction

Stringtop
$offset

Fade Offset

String2em
$transition

Transition Effects

String0.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 source

Description

Define the grid container

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$display

生成一个block-level或者inline-level网格容器:[flex|inline-flex]

Stringflex
$flex-direction

指定伸缩容器主轴的伸缩流方向:[row|row-reverse|column|column-reverse]

Stringnull
$flex-wrap

指定伸缩项目是否沿着侧轴排列:[nowrap|wrap|wrap-reverse]

Stringnull
$flex-flow

适用于flex容器元素,flex-direction和flex-wrap的缩写属性: [row|row-reverse|column|column-reverse] [nowrap|wrap|wrap-reverse]

Stringnull
$justify-content

指定伸缩项目沿主轴对齐方式:[flex-start|flex-end|center|space-betwwen|space-around]

Stringnull
$align-items

指定伸缩项目沿着侧轴对齐方式:[flex-start|flex-end|center|stretch]

Stringnull
$align-content

指定伸缩项目行在侧轴的对齐方式:[flex-start|flex-end|center|space-between|space-around|stretch]

Stringnull
$gutter

网格左右两端有margin值,null表示没有间距,percentage表示间距为百分比,length表示间距为固定值

Stringnull
$grid-type

网格类型:[skeleton|margin-offset]

Stringskeleton

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

grid-gutter

@mixin grid-gutter($margin: null, $margin-top: null, $margin-right: null, $margin-bottom: null, $margin-left: null) { ... }
View source

Description

Generate the margins around grids.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$margin

设置margin值:[null|]

Stringnull
$margin-top

设置margin-top值:[null|]

Stringnull
$margin-right

设置margin-rgiht值:[null|]

Stringnull
$margin-bottom

设置margin-bottom值:[null|]

Stringnull
$margin-left

设置margin-left值:[null|]

Stringnull

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 source

Description

Generate the grid columns

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$col

网格列数:[null|initial||auto|equal|none|breakpoint|]

Numbernull
$grid-columns

网格总列数

Number12
$col-offset

抵消列宽度:[null|]

Stringnull
$gutter

列间距:[null||]

Stringnull
$condensed

去掉列顶部和底部的margin

Booleanfalse
$align-self

单个伸缩项目侧轴对齐方式:[null|auto|flex-start|flex-end|center|baseline|stretch]

Stringnull
$flex-grow

Flex项目的扩大比例

Number0
$flex-shrink

定义Flex项目的缩小比例

Number1
$flex-basis

Flex项目在分配Flex容器剩余空间之前的一个默认尺寸:[|auto]

Numberauto
$order

控制Flex项目的顺序源

Numbernull
$grid-type

网格类型:[skeleton|margin-offset]

Stringskeleton
$last-child

当网格类型是margin-offset时,调整最后一列margin值

Booleanfalse

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

fluid-ratio

@mixin fluid-ratio($large-size, $small-size) { ... }
View source

Description

Fluid aspect rations for RWD background images

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$large-size

大的背景图片尺寸

Listnone
$small-size

小的背景图片尺寸

Listnone

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 source

Description

Full Width Containers in Limited Width Parents

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$support-type

有三个可选值marginpositiontranslate

Stringmargin
$min-width

父容器最小宽度

Numbernull

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 source

Description

Geometric size

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$width

容器的width

Numbernone
$height

容器的height

Numbernone
$basenoneNumber0

heightRelativeToWidth

@mixin heightRelativeToWidth($percentage: 100%, $pos: after) { ... }
View source

Description

容器高度相对于宽度的计算

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$percentage

高度和宽度一样

Number100%
$pos

通过伪元元素 after来撑开容器 [before] - 通过伪元素 before来撑开容器

Stringafter

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 source

Description

Has Lines

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$gutter

间距

Number20px
$color

线条颜色

String#ccc
$minWidth

线条宽度

Number20px
$height

线条粗细

Number1px

mq

@mixin mq($args...) { ... }
View source

Description

Sass Media Queries

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$args...noneListnone

Content

This mixin allows extra content to be passed (through the @content directive).

Used by

Links

Author

  • Rafal Bromirski

screen

@mixin screen($min, $max, $orientation: false) { ... }
View source

Description

Media Queries for screen

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$minnoneStringnone
$maxnoneStringnone
$orientationnoneBooleanfalse

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

max-screen

@mixin max-screen($max) { ... }
View source

Description

Media Queries for max screen

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$maxnoneStringnone

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

min-screen

@mixin min-screen($min) { ... }
View source

Description

Media Queries for min screen

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$minnoneStringnone

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 source

Description

Media Queries for screen height

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$minnoneStringnone
$maxnoneStringnone
$orientationnoneBooleanfalse

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 source

Description

Media Queries for max screen height

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$maxnoneStringnone

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 source

Description

Media Queries for min screen height

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$minnoneStringnone

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

hdpi

@mixin hdpi($ratio: 1.3) { ... }
View source

Description

Media Queries for hdpi

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$rationoneNumber1.3

Content

This mixin allows extra content to be passed (through the @content directive).

hdtv

@mixin hdtv($standard: 1080) { ... }
View source

Description

Media Queries for hdtv

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$standardnoneNumber1080

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

iphone4

@mixin iphone4($orientation: false) { ... }
View source

Description

Media Queries for iPhone4

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$orientationnoneBooleanfalse

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

iphone5

@mixin iphone5($orientation: false) { ... }
View source

Description

Media Queries for iPhone5

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$orientationnoneBooleanfalse

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

iphone6

@mixin iphone6($orientation: false) { ... }
View source

Description

Media Queries for iPhone6

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$orientationnoneBooleanfalse

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

iphone6-plus

@mixin iphone6-plus($orientation: false) { ... }
View source

Description

Media Queries for iPhone6 Plus

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$orientationnoneBooleanfalse

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

ipad

@mixin ipad($orientation: false) { ... }
View source

Description

Media Queries for iPad All

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$orientationnoneBooleanfalse

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

ipad-retina

@mixin ipad-retina($orientation: false) { ... }
View source

Description

Media Queries for iPad (Retina)

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$orientationnoneBooleanfalse

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

  • [mixin] mq

landscape

@mixin landscape() { ... }
View source

Description

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 source

Description

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 source

Description

Media queries with Sass Maps

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$qtypenoneStringnone

Content

This mixin allows extra content to be passed (through the @content directive).

Example

//SCSS

palette-town

@mixin palette-town($color, $type) { ... }
View source

Description

Try changing the $test-color variable in the CSS area and watch a new color palette generate!

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$colornoneListnone
$typenoneStringnone

Links

Author

  • jordiesaenz

plumber-box

@mixin plumber-box($grid-height: null, $margin: 0 0, $border: 0px 0px, $padding: 0) { ... }
View source

Description

Plumber extension to align boxes to the baseline grid

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$grid-height

Override the default grid height (Any unit | As set in Plumber)

Numbernull
$margin

Top and bottom margin as a multiple of grid height (One two integers)

Number0 0
$border

Top and bottom border width (One or two non-negative px values or 0s)

String0px 0px
$padding

Top and bottom padding as a multiple of grid height (One or two non-negative integers)

Number0

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

Links

Author

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 source

Description

Create better looking documents and speed up CSS development by adding vertical rhythm to your page.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$baseline

Baseline ratio (Fraction between 0 and 1)

Numbernull
$font-size

Font size as a fraction of grid height (Positive number)

Numbernull
$grid-height

Grid height (Any unit)

Stringnull
$leading-top

Top leading* as a multiple of grid height (Integer)

Numbernull
$leading-bottom

Bottom leading* as a multiple of grid height (Integer)

Numbernull
$line-height

Line height as a multiple of grid height (Positive integer)

Numbernull
$use-baseline-origin

Set the origin of leadings to the baseline

Booleannull

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

Links

Author

plumber-set-defaults

@mixin plumber-set-defaults() { ... }
View source

Description

Merge provided settings into the defaults map

Parameters

None.

border-polygon

@mixin border-polygon($num, $color: #000, $radius: 64px) { ... }
View source

Description

Border Polygon

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$num

多边型数量

Numbernone
$color

多边型颜色

String#000
$radius

多边型背景

Number64px

Links

Author

  • 大漠

clip-polygon

@mixin clip-polygon($num, $color, $radius) { ... }
View source

Description

使用 clip 制作多边形

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$num

多边形数量

Numbernone
$color

多边形颜色

Stringnone
$radius

多边形半径

Numbernone

Links

Author

  • 大漠

position

@mixin position($position, $args) { ... }
View source

Description

设置position

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$position

可选值: static | relative | absolute | fixed

Stringnone
$args

可设置值: top | right | bottom | left

Stringnone

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 source

Description

Mixin to customize scrollbars Beware, this does not work in all browsers

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$size

Horizontal scrollbar's height and vertical scrollbar's width

Lengthnone
$foreground-color

Scrollbar's color

Colornone
$background-color

Scrollbar's color

Colormix($foreground-color, white, 50%)

Example

Scrollbar styling

@include scrollbars(.5em, slategray);

Author

  • Hugo Giraudel

context

@mixin context($old-context, $new-context) { ... }
View source

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$old-context

选择器

Stringnone
$new-context

选择器

Stringnone

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 source

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$states

选择器组

Listnone

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 source

Description

伪元素

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$el

伪元素:before:after

Stringnone
$el-width

伪元素的width

Numbernone
$el-height

伪元素的 height

Numbernone

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 source

Description

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 source

Description

parent-nth-status($index, $status, $place: suffix)

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$indexnoneNumbernone
$statusnoneStringnone
$placenoneStringprefix/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

parent-status

@mixin parent-status($status, $place: prefix/suffix/prepend/append) { ... }
View source

Description

Parent Status

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$statusnoneStringnone
$placenoneStringprefix/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

at-least

@mixin at-least($count) { ... }
View source

Description

Query when total items is at least N items

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$count

Quantity to match (equal or more)

Numbernone

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 for at-least

  • #{$selector} is not a valid selector for at-least

Requires

at-most

@mixin at-most($count) { ... }
View source

Description

Query when total items is at most N items

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$count

Quantity to match (equal or less)

Numbernone

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 for at-most.

  • #{$selector} is not a valid selector for at-most

Requires

between

@mixin between($at-least, $at-most) { ... }
View source

Description

Query when total items is at least X items and at most Y items

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$at-least

Lower quantity of items to match

Numbernone
$at-most

Higher quantity of items to match

Numbernone

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 for between

  • #{$last} is not a valid number for between

  • #{$first} can´t be larger that #{$last} for between

  • #{$selector} is not a valid selector for between

Requires

exactly

@mixin exactly($count) { ... }
View source

Description

Query when total items is exactly N items

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$count

Quantity to match (equal)

Numbernone

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 for exactly

  • #{$selector} is not a valid selector for exactly

Requires

select-range

@mixin select-range($start, $end) { ... }
View source

Description

range selector mixin

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$start

开始值

Numbernone
$end

结束值

Numbernone

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 source

Description

mod query mixin

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$mod

整除倍数

Numbernone
$remainder

余数

Numbernone

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 source

Description

Set Dimensions

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$width

宽度

Numbernull
$height

高度

Number$width

Example

//SCSS
.box {
	@include dimensions(100px,200px);
}
//Output CSS
.box {
	width: 100px;
	height: 200px;
}

Used by

Author

  • Eliorshalev

spriteSpirit

@mixin spriteSpirit($name, $url, $vertical, $width, $hieght, $frameNum, $duration: .8, $iteration: 0, $reverse: false) { ... }
View source

Description

Sprite to Animate Mixin

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

动画名称

Stringnone
$url

Sprite图路径

Stringnone
$vertical

Sprite图是不是垂直排列

Booleannone
$width

Sprite图宽度

Numbernone
$hieght

Spritel图高度

Numbernone
$frameNum

动画帧数

Stringnone
$duration

动画播放持续时间

Number.8
$iteration

动画播放次数

Number0
$reverse

动画是不是反向播放

Booleanfalse

Example

//SCSS
.spriteAnimate {
	@include spriteSpirit(
		'sprite',
   		'//www.w3cplus.com/img/srpite.png',
	    false,
		800px,
	    100px,
	    8,
	    1s
	  )
}

Requires

Links

Author

  • Eliorshalev

tilted

@mixin tilted($angle, $color, $position: 'top', $pseudo: 'before') { ... }
View source

Description

Apply a tilted effect by generating a pseudo-element with a diagonal splitted background.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$angle

the tilt angle

Anglenone
$color

the color to be used as background + gradient

Colornone
$position

either top or bottom

String'top'
$pseudo

either before or after

String'before'

Requires

Author

  • Hugo Giraudel

fluid-type

@mixin fluid-type($properties, $min-vw, $max-vw, $min-value, $max-value) { ... }
View source

Description

Fluid vertical rhythm and Fluid Modular scale

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$properties

CSS属性

Stringnone
$min-vw

视窗最小宽度(viewport min-width)

Stringnone
$max-vw

视窗最大宽度(viewport max-width)

Stringnone
$min-value

最小值

Stringnone
$max-value

最大值

Stringnone

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

body

@mixin body($font-size: 18px, $base-line-height: 1.2, $base-font-size: 16px, $unit: "px") { ... }
View source

Description

To use in the body element.Outputs font-size and line-height.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$font-size

Base font size(Define $base-font-size)

Number18px
$base-line-height

Base line-height (Define $base-line-height)

Number1.2
$base-font-size

Default font size

Number16px
$unit

Unit to output (Define $base-unit)

String"px"

Example

body {
	@include body();
}
body {
    font-size: 18px;
    line-height: 22px;
}

Requires

Links

Author

  • hiulit

heading

@mixin heading($step, $unit: "px", $base-value: 18px, $scale-factor: 1.618, $base-line-height: 1.2) { ... }
View source

Description

To use in headings <h1> - <h4>.

Outputs font-size, line-height, margin-bottom and margin-top.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$step

<h1>$step: 3

<h2>$step: 2

<h3>$step: 1

<h4>$step: 0

Numbernone
$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)

Number18px
$scale-factor

Scale factor constants

Number1.618
$base-line-height

Base line-height

Number1.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

sgl-margins

@mixin sgl-margins($unit: "px", $base-value: 18px, $base-line-height: 1.2) { ... }
View source

Description

To use in <p>, <ul>, <ol>, <pre>, <table>, <blockquote>, etc.

Outputs margin-bottom and margin-top.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault 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)

Number18px
$base-line-height

Base line height

Number1.2

Example

p, ul, ol, pre, table, blockquote {
	@include margins();
}
p, ul, ol, pre, table, blockquote {
   margin-bottom: 22px;
   margin-top: 22px;
}

Requires