Development of websites and turnkey web projects is a comprehensive service. It differs from the...
BEM â is a methodology that helps you to create reusable components and code sharing in frontâend development Learn why it's better #opinions_box h1 { margin: 0 0 8px 0; text-align: center; } #opinions_box { p.more_pp { a { text-decoration: underline; } } input[type="text"] { border: 1px solid #ccc!important; } } .opinions-box { margin: 0 0 8px 0; text-align: center; &__view-more { text-decoration
ãã®è¨äºã¯BEM Advent Calendar 2013ã®22æ¥ç®ã®è¨äºã§ãã ãã¡ãã®è¨äºãèªãã§ãåãã¦BEMãç¥ãã¾ããã BEMã¨ããå½åè¦åã¨Sass 3.3ã®æ°ããè¨æ³ - ã¢ã¤ã³ã·ã¥ã¿ã¤ã³ã®é»è©±çªå· ã»ã¼ããã®ãã¡èª¿ã¹ã¦ã¿ãããã¨æã£ã¦ã¦ã人éå¿ è¦ã«è¿«ãããªãã¨ããã¾ããï¼ Advent Calendarã«åå ãããã¨ã§ãããªãããããªãçç±ãã¤ããã©ã¤ãããã¯ã ã¨ãããããã使ã£ã¦ããBootstrapãBEMã§è¨è¿°ããã¨ã©ããªãããèãã¦ã¿ã¾ããã ãããããããããã¼ã§BEMã Components - Navbar / Bootstrap bootstrapã®ã³ã¼ãã¯ãã <nav class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <a class="navba
ç®æ¬ãé ãã¾ãã åãä¼ç¤¾ã¨ãããã¨ããããæ®æ®µãããä¸è©±ã«ãªã£ã¦ããèè ã®è°·ããããç®æ¬ãé ãã¾ããããããã¨ããããã¾ãã æ®æ®µããCSSãWeb Componentsã§ç»å£ããã¦ãããã¨ããããå®å¿ã¨ä¿¡é ¼ã®å 容ã§ããã 以ä¸ã大ã¾ããªå 容ã®æ§æã¨ææ³æã§ãã ã¾ãã¯ã¤ã³ãã¬ã¹æ§ã®ãµã¤ãããç®æ¬¡ããå¼ç¨ï¼ 第1ç« CSSã«ãããè¨è¨ã¨ã¯ 1-1 CSSè¨è¨ã®éè¦æ§ ããã³ãã¨ã³ãã¨CSSã®ä»äº éçºã«æ¬ ãããªãè¨è¨ ããè¯ãCSSã®ã´ã¼ã« 1-2 ç ´ç¶»ããããCSS HTMLã®æ§é ã«ä¾åãã¦ãã ã¹ã¿ã¤ã«ãåãæ¶ãã¦ãã 絶対å¤ãå¤ç¨ãã¦ãã ä¿®æ£ããããCSS㸠ã¢ãã³ãªãµã¤ãæ§ç¯ã¯ã¼ã¯ãã㼠第2ç« CSSã®åºæ¬ãæ¯ãè¿ã 2-1 CSSã»ã¬ã¯ã¿ã¨è©³ç´°åº¦ ã«ã¹ã±ã¼ãã£ã³ã°ã®åºæ¬ 詳細度 詳細度ã®è¨ç® 2-2 ã»ã¬ã¯ã¿ã®ãªãã¡ã¯ã¿ãªã³ã° ã»ã¬ã¯ã¿ãããå®å ¨ã§ã·ã³ãã«ãªãã®ã« è¦ç´ ã»ã¬
ã¤ãããCSSè¨è¨ NTTã¬ã¾ãã³ãã森æ¬æå¹³ â»ç¢å°ãã¼ã§åããã¾ã About Me 森æ¬æå¹³ ãã£ã¬ã¯ã¿ã¼ ããã³ãã¨ã³ãã¨ã³ã¸ã㢠Twitter:basara669 ä»æ¥ã®ã¹ã©ã¤ã http://basara669.com/slides/140122/index.html â»ä»æ¥ã®atndãconnpassã«ãè¼ã£ã¦ãã¾ã ä»æ¥ã®ããã·ã¥ã¿ã° #gooOTT Agenda ãªãCSSè¨è¨ãå¿ è¦ãªã®ã BEMã¨SMACSSã®ç´¹ä» å®éã®éç¨ä¸ã©ãããã¹ãã æ¬é¡ã«å ¥ãåã«ã»ã»ã» æ§ã ãªCSSè¨è¨ãããã¾ãããã©ããè¤æ°ã¯ã©ã¹ãåæã¨ãã¦ããã®ã§ãIE6以ä¸ã§ã¯ä½¿ããªãã§ããã
BEMããã³ãã®å½åæ´¾çã¨ãã¦ã®MindBEMdingã§ä½¿ãããfoo__barãfoo--barã¨ãããããªãã¤ãã³ãã¢ã³ãã¼ã¹ã³ã¢ãéããå½åã¯ãã¢ããåé·ã ã¨å«ãããã¡ã ãåèªèº«ãåè¦ã§ã¯ãã®ããã«æã£ã¦ããããããããã¯æ¬å½ã«è¯ãã¢ã¤ãã¢ã ã¨æãããå®åã§ãåã¯æ¡ç¨ãã¦ããã CSSã®è¨è¨ããã®å½åã®ã¨ãã«èããã®ã¯ããããããã«æç½ã§ãããã¨ãããã¨ã¨ãæ±æããããªã¹ã¯ãæããããããã¨ãããã¨ã ãã¯ã¼ããæ確ã«åºåããã¨ã«ãã£ã¦ããã®æ©è½ã»ã«ãã´ãªãåºå¥ããã¨ããç¹ã«ããã¦ã¯ãå¥ã«åä¸è¨å·ã§ããããããã£ã¡ã«ã±ã¼ã¹ãã¹ãã¼ã¯ã±ã¼ã¹ã§ãããããªãã§ããããããããªãããããã¹ã¿ã¤ã«ãæ±æããããªã¹ã¯ãã¨ããç¹ã§ãã®çå¦ãªå½åã¯åªç§ã ã ããã¸ã§ã¯ãã«é¢ããéçºè ãå¤ãã»ã©ããã®æ¸ãæ¹ã«ãã¬ã¯çããããã¡ããã³ã¼ãã£ã³ã°è¦ç´ãªããã¹ã¿ã¤ã«ã¬ã¤ããªãã§ãããããã«ã¼ã«ãå ±æãã¦ããã°
OOCSSãã¯ããã¨ããCSSè¨è¨ã«ãããã¢ã¸ã¥ã¼ã«æåã®ã¢ããã¼ãã®è©±ã«ãªãã¨ãä¸è¨ã®ãããªåä¸ããããã£ã§å®ç¾©ãããã«ã¼ã«ãçµã¿åããããã®ãæããã¨ãããããªèª¬æããããå ´åãããã .size1of4 { width: 25%; } .mrs { margin-right: 10px; } .font-small { font-size: 10px; } .text-left { text-align: left; } ãããã¯Utilityã¨ããHelperã¨ããæ±ç¨ã¯ã©ã¹ã¨ããããã«å¼ã°ããããã°ä½ãã¨ä¾¿å©ãªã«ã¼ã«ã ã ã©ãããã¨ãã«ä¾¿å©ãã¨ããã®ã¯ãåçªãªãã¶ã¤ã³å¤æ´è¦æ±ãªã©ã«ãé½åº¦ãã®ããã®ã«ã¼ã«ãå®ç¾©ãããããããããã®æ±ç¨ã¯ã©ã¹ã®çµã¿åããã§å¯¾å¿ã§ããã¨ãããã¨ãæããããã ããã <div class="mts text-center"> <img src="ban
ã¯ããã« Multilayer CSSæ§æã·ã¹ãã ã¯BEMã¨OOCSSã®åçãåºã«ãã¦ãã¾ãããã®æ¹æ³ã¯Odnoklassniki.ruï¼ä¸çã®ã½ã¼ã·ã£ã«ãããã¯ã¼ã¯ã®TOP10ï¼éçºãã¼ã ã«ãã£ã¦ä½ãåºãããããã¥ã¡ã³ãã¨ãã¼ã ãã¼ã¹ã®ã·ã¹ãã ã®ä¸æ ¸ã¨ãã¦éçºè ã«ãå§ãã§ãã ãã®æ¹æ³ã¯60人以ä¸ã®éçºè ã¨å¤ãã®å é¨ãµã¼ãã¹ã¨ãã巨大ãªããã¸ã§ã¯ãããçã¾ãã¾ããããä¸å°è¦æ¨¡ã®ããã¸ã§ã¯ãã«ãç°¡åã«å°å ¥ã§ãã¾ãããã®æ¡å¼µæ§ã«ãããéçºè ã¯ã«ã¼ã«ã®å³æ ¼ãã®ã¬ãã«ãé¸æã§ãã¾ãã ãã®ããã¥ã¡ã³ãã¯ããã¥ã¡ã³ãä½æã¨ã³ã¸ã³Sourceãªã©ã®è£å©ãã¼ã«ã使ãã常ã«æ¹åããã¦ãã¾ãããªãªã¸ãã«ã®ããã¥ã¡ã³ãã¯ãã·ã¢èªã§è¨è¿°ããã¦ãããå ¨ã¦ã®æ å ±ã¯ã¾ã 翻訳ããã¦ãã¾ãããã翻訳ã®ãã«ãªã¯ã¨ã¹ãã¯ãæ°è»½ã«ã©ããã ä½ã質åãããã°Issues section on Githubã¾ãã¯ã¡ã¼ã«ã¢ãã¬ã¹r
SCSSãã¡ã¤ã«ãæ´çãç´ãã¦ããæãä¸æ°ã«BEMãªã¯ã©ã¹ã使ã£ã¦æ¸ããªããã¦ããããã¨ãèãã¦ããããã©éä¸ã§SassãªãSCSSãã¡ã¤ã«ã®åå²ã¨ãã®ä¸ã§ã®å·¥å¤«ã«ãã£ã¦BEMã®æ§é ã表ç¾ã§ãããã¨æããã®ã§ãä»ã¯ããããæ¹åã§è©¦è¡é¯èª¤ãã¦ãããå®éBEMã®ã¦ã§ããµã¤ãã§ããã¡ã¤ã«ã·ã¹ãã ã使ã£ãBEMã®è¡¨ç¾æ¹æ³ã¨ããä¼¼ã話ãæ¸ããã¦ããã®ã§èåç¡ç¨½ãªèãã§ã¯ãªãããã SCSSãã¡ã¤ã«åã§blockãè¡¨ç¾ ãã®ä¸ã§placeholder selectorã使ã£ã¦elementã¨modifierãè¡¨ç¾ å¤ããã¯ãã®placeholder selectorã¯ä½¿ããªã æ¢åã®ãã¼ã¯ã¢ãããå©ç¨ããã»ã¬ã¯ã¿ã¼ãã@extendã§BEMæ§é ãé¢é£ä»ã HTMLãã¡ã¤ã«ã§ã¯BEMãªã¯ã©ã¹ã¯æ¯ããªã å¿ è¦ãªå ´åã¯ã·ã³ãã«ãªã¯ã©ã¹ãæ¯ã ã¤ã¡ã¼ã¸ã¯ãã®ãããªæããHTMLã§ã®ãã¼ã¯ã¢ããã®ç°¡æ½ãã¯ç¶æã§
BEMã使ã£ãå½åãã¨ã¦ãæå¿«ã§ããã®ã¨ããHTMLãCSSãæ¸ãã®ã«ãã使ã£ã¦ãããCSSã®ã¯ã©ã¹åã¨ãã¦æ¸ãå ´åã¯ãBEMãCSSç¨ã«ä½¿ããããããMindBEMdingã¨ããæ¸ãæ¹ãæ¡ç¨ãã¦ãããæåã«ãããç¥ã£ãã¨ãã¯ããããªæ±ãè¨è¿°ã®ä»æ¹ã¯ä½¿ããããªããã¨æã£ã¦ããã ãã©ããã£ããæ £ãã¦ãä»ã§ã¯ãã®æå¿«ãã«ã¡ãã£ã¨å¿é ãããã¦ããã»ã©ã BEMã®æ¹æ³è«ã¨MindBEMdingã®ã«ã¼ã«ã«ã¤ãã¦ã¯ããããã®ææ¸ãèªãã§ãããã¨ãã¦ãããããã²ã£ãããã¦å¤§éæã«èª¬æããã¨ãBEMã¨ã¯BlockãElementãModifierã®é æåãåã£ããã®ã§ãæ§æããè¦ç´ ããã®ã©ããã«å½ã¦ã¯ãã¦å½åãã¦ããæ¹æ³ãã©ã®å ´åã§ãå¿ ãBlockãããã¯ãã®Modifierãã«ã¼ãã«ããããã®ä¸ã«ãæå±ããElementãããã¯ãã®Modifierãå«ã¾ããæ§æã«ãªãã Block - æ§æã®ã«ã¼ãã¨ãª
å ¬éæ¥2013-12-02ã¿ã°Advent CalendarBEMCSSHTMLä»å¹´ããã¨ä¸æã¨ãããã¨ã§ããã°ããªãã¶ã¤ã³ãã¾ãããã¨ãããã¨ã§ãã®è¨äºã¯BEM Advent Calendar 2013 ï¼æ¥ç®ã®ã¨ã³ããªã§ããæ¥ä»éãã¦ãã¾ãã¾ãããã BEM ã£ã¦ä½ï¼ BEM ã¨ã¯ Block, Element, Modifier ã®é æåãã¨ã£ããã®ã§ãããã³ãã¨ã³ãè¨è¨ã«ããã¦å½åè¦åãã¢ã¸ã¥ã¼ã«ã®ç®¡çã«åè¿°ã®ï¼ç¨®é¡ã®åºåãåãå ¥ãããã®ãè¨ãã¾ããä»åã¯ã¿ã¤ãã«ã«ãããéããCSS ã®å½åè¦åã« BEM ãåãå ¥ãã¦ã¿ãã¨ãããã¨ã§ãBEM 㪠CSS ã«ã¤ãã¦è¨è¼ãã¾ãã BEM ãã¨ã©ãããè¯ããã¨ãããã®ï¼ ããããªäººããã§ã«æ¸ãã¦ããã®ã§å¥ã¨ã³ããªãåèã«ãªãã£ã¦ãã ããããããã¯ãä»åã® Advent Calendar ã«åå ããæ¹ã®ã¨ã³ããªãåèã«ãªããã¨æãã¾ãã
Modular code is reusable code. It can be combined in a variety of ways, making it flexible and scalable, allowing you to iterate code blocks independently and leading to better performance and more maintainable sites. Object Oriented CSS (OOCSS), Scalable and Modular Architecture for CSS (SMACSS), Donât Repeat Yourself CSS (DRY CSS), and Block, Element, Modifier (BEM) are four popular methods for
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}