-
?? ??? ?? ??? ?? SASS?? ??? ?? ?? ??? ?? ? ????. ????
- ???? ???? ? ??? ???? ???? ???? ?? ??? ???? ?? ???? ?? ?????.
-
Sass Mixin ?? ??? ?? ??? ???? ??? ???? SASS ??? ???? ?????.
type-of()
???? ??? ?? ?? ???? ??? ? ???? ??? ??? ??? ???? ??? ?? ??? ??? ?? ? ? ????.unit()
unitless()
Sass? ???? ?? ???? ??? ? ??? ???? ?? ??? ??? ? ????. ??, ???, ?? Sass? ?? ?? (?? ? ?? ?)? ??? ?, ?? ? ??? ??????. ??? ? ?? ????. ??? Sass? ??? ? Sass? ?? ?? ???? ???? ? ????? ?? ??? ??? ????. -
@function
?? ?? ???????? ?? ??? ?? ??? ?????. ??? ??? ?? ????? ????? ?? ?? ?????? ???? ?? ?? ??? ??? ????? ???????. ??? ??? ?? ??? ??? ???? ? ?????. @return
??? ????? ?????? : -
?? ?? MixIn? ??? ?? ??? ???? ?? ??? @error
??? ???? ??? ????? ??????. ? ??? ??? ???? ?????? ??? ?? true ?? false? ?????.
- ??? ??
- ?? bool
- null ??
- ??
- ? ???? ?? ??? ?? ? ?? ? ? ??????.
-
??? ?? ?? ?? ?? ??? ?? ???? ??? ?? ??? ?? ??? ??? ? ????.
??? ?????? - ? ???? ?? ??? ??? ??? ??? ? ????. ?? ??, ?? ?? ???? ?? ? REM ?? ??? ?? ? ????. ( ?? ??? ?? ???? ? ? ???? ?? ????. ??? Sass? ??????? ?? ?????. ) .
@mixin create-font-size() { @if variable-exists(base-font) { font-size: $base-font; } @else { @error "請定義變量 `$base-font`。"; } @if variable-exists(line-height) { line-height: $line-height; } @else { @error "請定義變量 `$line-height`。"; } } // 開發(fā)者的代碼 $base-font: 18px; $line-height: 1.5; .element { @include create-font-size; }? ???? ??? ?????. ?? ?? ??? ??? ??? ????? ??? ??? ??? ? ? ????.
type-of()
??? ?? ??? ??? ??? ?????. ?????, ?? (??) ?? null? ?? ??? ???????. ??? ??? ?? ??? ????, ??? ??? ?? ??? ?? ?? ?????.
// 你的插件: $base-font: 18px !default; $line-height: 1.5 !default; @mixin create-font-size() { //等等... } // 開發(fā)者的代碼: $base-font: 16px; p { @include create-font-size(); }
@mixin size($height, $width: $height) { @if type-of($height) == number { height: $height; } @else { @warn "確保 `$height` 是一個數(shù)字。"; } @if type-of($width) == number { width: $width; } @else { @warn "確保 `$width` 是一個數(shù)字。"; } }
??? ???? ???? ?? ?? ????? ??? ? ????. ? ?? ? ??? ?? ??? ???? ?? : ? ??? ???? ?? ?? ?????.
unit()
<<> ??? ??? ?????? ? ??>
unit()
?? ??? ? ??> ?? ? (?? ?? ? ?? ??)? ??? ? ? ??> mixin? ?????. ??? ?? ??, ?? ??? ?? ?? ? ??? ?????.
function-exists()
? ??> <<>?? ?? : ? ??> ? ? ??> pow()
@mixin create-font-size() { @if variable-exists(base-font) { font-size: $base-font; } @else { @error "請定義變量 `$base-font`。"; } @if variable-exists(line-height) { line-height: $line-height; } @else { @error "請定義變量 `$line-height`。"; } } // 開發(fā)者的代碼 $base-font: 18px; $line-height: 1.5; .element { @include create-font-size; }??? ????? ??? ????? ? ? (?? ???? ?????, ?? ??? ?? ?? ???) ? ???? ???? ??? ??? ????? ?????.
@warn
? ???? ?? ??? ???? ??? ?? ?? ?? ?? SitePoint? Sass ??? ?? ??? ??? ? ????. @error
??
@warn
Sass Mixin? ?? ?? ? ?? FAQS (FAQ)
@error
SASS? Mixin ? ??? ??? ???? ? ??? ??? ? ?? ?? ??? ?????. ???? ,
? ??? Sass Mixin ? ??? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

CSS?? ????? ??? ? ?? ??? ????. 1. HTML ? CSS? ?? ??? ?????? ???? ?? ???? ?? ???? ??????. 2. ?? ??? ??? ?? ???? ???? ?? ?? ??? ?? ?? ??? ??????. 3. ??? ????? ???? JavaScript? ?? ???? ?????? ??? ?????. ? ?? ??? ??? ??? ????? ?? ??, ??, ??? ? ?? ???? ?? ?? ?? ??? ???? ?????.

CSS ???? ??? ? ??? ??? ????? ???? ??? ???? ???? ?? ?? ???? ????? ???????. 1. Flexbox ? ??? ??? ?? ???? ??? ??, ?? : ??? ?? ? ????? ??? ????. 2. Caniuse ?? ?? ?? ??? ??????. 3. -webkit-, -moz-, -ms-, -o- ? ?? ???? ???? ???? ?????. 4. AutoPrefixer? ???? ???? ???? ???? ?? ????. 5. ?? ????? ????? PostCSS? ???? BrowsersList? ??????. 6. ?? ? ???? ???? ?????. 7. Modernizr ?? ??? ??? ????? ??? ? ????. 8. ?? ????? ???? ?? ? ??? ????.

CSS? ?? ?? ??? ??? ??? ???? ???? SVG? ???? ?? ???, ?? ????, ??? ?? ?? ??? ?? ???? ??????. ??? ??? ????. 1. ?, ??, ??? ?? ?? ??? ?? ??? ?????. 2. ?? ?? ? ??? ???? ??? ? ????. 3. ?????? ?? ?? ?? ?? ????? ???? ?? ??? ?? ? ? ????. 4. ???? ???? ??? ??? ??? ????? ?? ? ??? ????. ???? ???? ?? ?? ?? : ? (50pxatcenter) ? ??? ?? ?? : ??? (50%0%, 100 0%, 0%)? ?? ????. ????

themaindifferencesbetweendisplay : ???, ??, andinline-blockinhtml/cssarelayoutbehavior, spaceusage ? stylingcontrol.1.inlineElementsFlowWithText, do n'tStartonnewlines, ingorewidth/height, andonlyapplyhorizontalpadding/margins —IdealforIneTeTexting

??? ?? ???? ???? ??? ??, ?? ??? ??? ? ? ????? ??? ??? ???? ???? ? ? ?? ? ? ????. 1. CSS ?? : ?? ??? ???? ???? ?? ??; 2. ????? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 3. ?? ??? ??? ??? ??? ?? ?? ???? ????????. 4. ??? ????? ??? ???? ?? ? ??? ??? ?? ??? ?? ?? ??? ????? ???? ?? ????.

CSS? ???? ?? ? ???? ???? ??? ?? ??? ?? ?? ?? ? ? ????. 1. Max width : 100% ? ?? : Auto? ???? ???? ??? ????? ???? ??? ??? ? ??????. 2. HTML? SRCSET ? ?? ??? ???? ?? ??? ??? ??? ??? ???????????. 3. ?? ?? ? ?? ??? ???? ??? ??? ? ?? ?????? ??????. ? ??? ?? ???? ?? ???? ???? ???? ????????.

?? ????? CSS ?? ??? ????? ?? ?? ??? ??, ?? ?? ?? ??, Flexbox ? ??? ???? ?? ?? ? ?? CSS ??? ????? ??? ???? ???? ?? ????? ??? ?????. 1. ?? ??? ??? ???? ????. ???? CSSRESET ?? NALLER.CSS? ???? ?? ???? ???? ????. 2. IE? ?? ??? ?? ?? ?? ??? ????. ?? ?? : ?? ? ???? ??? ??? ???? ?? ????. 3. Flexbox ? Grid? Edge Case ?? Old ???? ??? ?????. ? ?? ??? ? AutopRefixer ??; 4. ?? CSS ?? ??? ???? ????. Caniuse? ???? ?? ?????????.

CSS ??? ??? ?? ?? ?? ? ?? ? ?? ??? ?? ????. 1.px? ?? ??? ????? ?? ??? ??? ?? ??? ?????. 2.EM? ?? ????, ?? ?? ??? ??? ?? ?? ???? ??, REM? ?? ??? ???? ? ????? ??? ????? ?????. 3.VW/VH? ?? ? ???? ??? ??? ??? ??????? ?? ???? ?????? ???????. 4. ??? ?? ?? ? ??, ?? ?? ?? ? ??? ???? ???? ???????. ???? ??? ???? ??? ? ?? ??? ???? ? ????.
