Styluså ¥é Stylusã¯SASSãLESSã®ãããªCSSã¡ã¿è¨èªãææã§è©±é¡ã«ããã£ãã®ã§ã©ããªãã¨ãã§ããã®ãä¸éã触ã£ã¦ã¿ã¾ããã å®è¡ç°å¢ã§ããé常ã¯node.jsãªã©ã®ã¤ã³ã¹ãã¼ã«ãå¿ è¦ã§ããç§ã®å ´åãCodeKitãå©ç¨ãã¦ããã®ã§ç¹ã«ãªã«ãã¤ã³ã¹ãã¼ã«ããã«å©ç¨ã§ãã¾ããã stylusç¨ã®ãã¡ã¤ã«ãstylus/ââ.stylã¨ãã¦ä¿åããã¨ãcss/ââ.cssã¨æ¸ãåºããã¾ããããã§ã¯ãã£ããã¨åºæ¬æ©è½ã®ç´¹ä»ãã¾ãã Selectorsï¼ã»ã¬ã¯ã¿ï¼ stylusã¯Pythonããã«ã¤ã³ãã³ããã¼ã¹ã®è¨è¿°ãè¡ãã¾ãã .hoge color blue font-weight bold ã¨è¨è¿°ããã¨ä»¥ä¸ã®ãããªCSSãåºåããã¾ãã .hoge { color: #00f; font-weight: bold; } ãã®ããã«åºæ¬çã«æ¬å¼§ãã»ãã³ãã³ãã³ãã³ãªã©ã¯çç¥
Stylusï¼ã¹ã¿ã¤ã©ã¹ï¼ã使ããã¨ã§CSSããã¯ãã«ã«è¨è¿°ã§ãã¾ãã Stylusã®ã¤ã³ã¹ãã¼ã« Stylusãã¤ã³ã¹ãã¼ã«ãã¾ããã¤ã³ã¹ãã¼ã«ã«ã¯NodeJSãã¤ã³ã¹ãã¼ã«ããã¦ããå¿ è¦ãããã¾ãã npm i -g stylus Stylusã¨CSS 試ãã«é©å½ãªCSSãæ¸ãã¦ã¿ã¾ããã .css { color: #000; } Stylusã§ãåããã¨ãæ¸ãã¦ã¿ã¾ãã .stylus color #000 è¦ã¦ã®éãã{},:,;ãè¨è¿°ããå¿ è¦ã¯ããã¾ããããããããè¨è¿°ãã¦ã大ä¸å¤«ã§ãã ä¾ãã°ãcolor: #000ã¨ãã¦ãOKã ã¡ãªã¿ã«Emmetã¯ã:ãæã¾ãªãå½¢ã§å±éãããã®ã§ãè¨è¿°ããªãæ¹ã«æ £ããã»ããããããã 追è¨ãAtomã§ã§ãããï¼ï¼ã³ãã³ï¼ãéã«æãã§å±éããããã«è¨å®ããè¨äºãæ¸ãã¾ããã Stylueã®ä½¿ãæ¹ ã»ã¬ã¯ã¿ã®ãã¹ã 次ã®ããã«.parentå
Macã§ã®è¨å®æ¹æ³ã§ãã emmet-atomãATOMã¸ã¤ã³ã¹ãã¼ã«ããå¾ãpreferences.jsonãã¡ã¤ã«ãä½æããããã¸è¨å®ãæ¸ãã¾ãã emmet-atomã®README.mdãèªãã¨ãè¨å®ãã¡ã¤ã«ã¯~/emmetã¸ç½®ãã°ããã¨ã®ãã¨ã ãªã®ã§ã~/emmet/preferences.jsonã¨ããå½¢ã«ãªãããã«ä½æããéãã¾ãã mkdir ~/emmet && touch ~/emmet/preferences.json && open ~/emmet/preferences.json ããã¦æ¬¡ãã³ããã { "stylus.valueSeparator": ": " } ããã¾ã§ããæã§ãä¸åº¦ATOMãåèµ·åã .stylãã¡ã¤ã«ãéãã¦ãdbã¨å ¥åããtabãæ¼ãã¾ãã display block ããéã«ã³ãã³ããªãç¶æ ã§å±éããã¦ãã¾ãã¾ããã ã¡ããã¨ããã³ã
CSS Preprocessor Advent Calendar 2012ã19æ¥ç®ã®è¨äºã§ãã CSS Preprocessorã¯ãCSSã«æ¡å¼µæ©è½ãæãããã¡ã¿è¨èªã¨å¼ã°ãããã®ã§ãã CSS Preprocessorã§ããè³ã«ãããã®ã«ãSassãLessãããã¾ãã ç§ã以åããSassã使ç¨ãã¦ãã¾ããããæè¿Stylusã使ãå§ããã®ã§ãSassã¨Stylusã®æ¯è¼ãè¡ã£ã¦ã¿ã¾ãã æ¡å¼µåã¨ã·ã³ã¿ãã¯ã¹ 使ç¨ã§ããæ¡å¼µåã¯.sassã¨.scssã®2ã¤ã æ¡å¼µåã«ãã£ã¦Sassè¨æ³ãSCSS(Sassy CSS)è¨æ³ã«åããã¾ãã Sassè¨æ³(.sass) #header color: #000 h1 font-size: 2em SCSSè¨æ³(.scss) #header { color: #000; h1 { font-size: 2em; } } SCSSè¨æ³ã®æ¹ããã¨ã
ããã¾ã§ Basis 㯠Sass/CSS ãã¬ã¼ã ã¯ã¼ã¯ã¨ãã¦éçºãã¦ãã¾ããããå æ¥æ¸ããè¨äºï¼SassããStylusã«ä¹ãæãã¦ã¿ãã®ã§éããèºããã¨ãããªã©ï¼ã®ã¨ãã Stylus ããªããªãè¯ãæ°ã ã£ãã®ã§ Stylus çã® Basis ãä½ãã¾ããã ãã®ä¸ã§ãStylus ã§ãããªãåç´ã« Sass ãæ¸ãæããã ããããªãè¨è¨ããå¤ããã»ããè¯ãã®ã§ã¯ãªããï¼ã¨ããæ°ããã¦å é¨çã«ã¯çµæ§æ¸ãæããè¡ã£ããããã®ã§ããã®è¾ºããå«ããBasis ã¨ã¯ä½ããã©ãããææ³ã«åºã¥ãã¦éçºãã¦ããã®ããçæ¹ãã¦ã¾ã¨ãã¦ã¿ããã¨æãã¾ãã Basis Stylus çããã¥ã¡ã³ã https://getbasis.github.io Basis ã®è¨è¨ææ³ Basis ã¯ãã©ã㪠Web ãµã¤ãã®å¶ä½ã«ãé©ç¨ã§ããç°¡åã«ä½¿ããéªéã«ãªããªã CSS ãã¬ã¼ã ã¯ã¼ã¯ã欲ãããã¨ã®æãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}