Sass 简介
Sass 安装
Sass 变量
Sass Nested Rules and Properties
Sass @import and Partials
Sass @mixin and @include
Sass @extend and Inheritance
Sass 函数
Sass String
Sass Numeric
Sass List
Sass Map
Sass Selector
Sass Introspection
Sass Color
Sass Numeric - SASS基础教程 - 笔下光年
网站首页
Sass Numeric
The numeric functions are used to manipulate numeric values. The following table lists all numeric functions in Sass: | Function | Description & Example | |------------------------|---------------------------------------------------| | abs(number) | Returns the absolute value of number. <br/><br/>**Example:**<br/>abs(15)Result: `15abs(-15)`<br/>Result: `15` | | ceil(number) | Rounds number up to the nearest integer. <br/><br/>**Example:**<br/>`ceil(15.20)`<br/>Result: `16` | | comparable(num1, num2) | Returns whether num1 and num2 are comparable. <br/><br/>**Example:**<br/>`comparable(15px, 10px)`<br/>Result: `truecomparable(20mm, 1cm)`<br/>Result: `truecomparable(35px, 2em)`<br/>Result: `false` | | floor(number) | Rounds number down to the nearest integer. <br/><br/>**Example:**<br/>`floor(15.80)`<br/>Result: `15` | | max(number...) | Returns the highest value of several numbers. <br/><br/>**Example:**<br/>`max(5, 7, 9, 0, -3, -7)`<br/>Result: `9` | | min(number...) | Returns the lowest value of several numbers. <br/><br/>**Example:**<br/>`min(5, 7, 9, 0, -3, -7)`<br/>Result: `-7` | | percentage(number) | Converts number to a percentage (multiplies the number with 100). <br/><br/>**Example:**<br/>`percentage(1.2)`<br/>Result: `120` | | random() | Returns a random number between 0 and 1. <br/><br/>**Example:**<br/>`random()`<br/>Result: `0.45673` | | random(number) | Returns a random integer between 1 and number. <br/><br/>**Example:**<br/>`random(6)`<br/>Result: `4` | | round(number) | Rounds number to the nearest integer. <br/><br/>**Example:**<br/>`round(15.20)`<br/>Result: `15round(15.80)`<br/>Result: `16` |
上一篇:
Sass String
下一篇:
Sass List