compilation du nouveau css
This commit is contained in:
parent
063f84f1ad
commit
75a822112f
20 changed files with 2804 additions and 0 deletions
52
src/scss/function/_calc-font-size.scss
Normal file
52
src/scss/function/_calc-font-size.scss
Normal file
|
@ -0,0 +1,52 @@
|
|||
@charset "utf-8";
|
||||
|
||||
// Built-In Modules
|
||||
@use 'sass:math';
|
||||
|
||||
// Included Modules
|
||||
@use 'strip-unit';
|
||||
|
||||
// ===================================================================
|
||||
// px to em
|
||||
// ===================================================================
|
||||
|
||||
@function px2em($px, $base: 16) {
|
||||
@return math.div(strip-unit.strip-unit($px), strip-unit.strip-unit($base)) * 1em;
|
||||
}
|
||||
|
||||
@function px2rem($px, $base: 16) {
|
||||
@return math.div(strip-unit.strip-unit($px), strip-unit.strip-unit($base)) * 1rem;
|
||||
}
|
||||
// ===================================================================
|
||||
// percent to px
|
||||
// ========================================================n===========
|
||||
|
||||
@function percent2px($percent, $base: 16) {
|
||||
@return strip-unit.strip-unit($base) * math.div(strip-unit.strip-unit($percent), 100) * 1px;
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
// percent to em
|
||||
// ===================================================================
|
||||
|
||||
@function percent2em($percent, $base: 16) {
|
||||
$ratio: math.div((strip-unit.strip-unit($percent), 100));
|
||||
@return math.div(strip-unit.strip-unit($base) * $ratio, strip-unit.strip-unit($base)) * 1em;
|
||||
}
|
||||
|
||||
@function percent2rem($percent, $base: 16) {
|
||||
$ratio: math.div((strip-unit.strip-unit($percent), 100));
|
||||
@return math.div((strip-unit.strip-unit($base) * $ratio), strip-unit.strip-unit($base)) * 1rem;
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
// em to px
|
||||
// ===================================================================
|
||||
|
||||
@function em2px($em, $base: 16) {
|
||||
@return strip-unit.strip-unit($em) * strip-unit.strip-unit($base) * 1px;
|
||||
}
|
||||
|
||||
@function rem2px($rem, $base: 16) {
|
||||
@return strip-unit.strip-unit($rem) * strip-unit.strip-unit($base) * 1px;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue