Sha256: 89bca911e90e42f029b12e7282b479a64bbc3af9fe417c00f058bdacc28b2ff0
Contents?: true
Size: 1.92 KB
Versions: 3
Compression:
Stored size: 1.92 KB
Contents
// Baseline, measured in pixels // The value should be the same as the font-size value for the html element // If the html element's font-size is set to 62.5% (of the browser's default font-size of 16px), // then the variable below would be 10px. // original https://github.com/bitmanic/rem // customize by machida $baseline-px: 10px =base-font-size font-size: $baseline-px font-size: strip_unit($baseline-px / 10) * 1rem =rem($property, $px-values, $important: null) // 9px以下のfont-sizeを使う設定(IE8不可) @if px($px-values) or list($px-values) @if $property == "font-size" and $px-values < 10px +base-font-size +scale3d(strip_unit($px-values / strip_unit($baseline-px)), strip_unit($px-values/ strip_unit($baseline-px)), 1) +transform-origin(0, 0) @else // Convert the baseline into rems $baseline-rem: $baseline-px / 1rem // remが使えないブラウザ用にpx版を出力 @if $important #{$property}: $px-values !important @else #{$property}: $px-values // remで出力 @if px($px-values) and $px-values >= 1 @if $important #{$property}: $px-values / $baseline-rem !important @else #{$property}: $px-values / $baseline-rem @else // Create an empty list that we can dump values into $rem-values: () @each $value in $px-values // If the value is zero or not a number, return it @if $value == 0 or type-of( $value ) != "number" $rem-values: append($rem-values, $value) @else $rem-values: append($rem-values, $value / $baseline-rem) // Return the property and its list of converted values @if $important #{$property}: $rem-values !important @else #{$property}: $rem-values @else @if $important #{$property}: $px-values !important @else #{$property}: $px-values
Version data entries
3 entries across 3 versions & 1 rubygems