我的手是你的顏色,但我感到羞恥
戴上如此潔白的心。
——威廉‧莎士比亞, 《馬克白》
莎士比亞不會滿足於在 CSS 中使用“顏色”而不是“顏色”,你也不應該!他會體認到,這樣做就體現了他寫作的全部完整性。
使用postcss-spiffing
在任何地方使用正確的英式英語編寫 CSS。
這與 muan 的spiffing
之間的主要區別在於,它與postcss
整合並且不使用正規表示式。
npm install postcss-spiffing --save-dev
/* Your well-spelt CSS */
body {
background-colour : grey;
transparency : 0.3 ;
text-align : centre;
text-transform : capitalise;
border : 1 px solid grey;
}
span {
font-weight : plump;
}
. frame {
background-photograph : url ( "/queen.png" ) !please;
}
. hello {
content : "subjects" ;
colour : grey;
}
將前往:
body {
background-color : gray;
opacity : 0.7 ;
text-align : center;
text-transform : capitalize;
border : 1 px solid gray;
}
span {
font-weight : bold;
}
. frame {
background-image : url ( "/queen.png" ) !important ;
}
. hello {
content : "subjects" ;
color : gray;
}
var postcss = require ( "postcss" ) ;
var spiffing = require ( "postcss-spiffing" ) ;
var fs = require ( "fs" ) ;
var css = fs . readFileSync ( "random.css" ) ;
console . log ( postcss ( spiffing ( ) ) . process ( css ) . css ) ;
若要將其與gulp
一起使用,請使用 gulp-postcss。
colour
歸color
plump
變成bold
capitalise
去capitalize
!please
!important
centre
到center
grey
變成gray
background-photograph
前往background-image
(也支援list-style-photograph
)transparency
變成opacity
(因為透明度與不透明度相反,所以變成 (1-n))storey
轉到z-index
( ground
等於 1 等)