Post by rubina9898 on Dec 25, 2023 7:21:29 GMT
Let's create a class login formfieldand apply it to each element input in the form. to the double underscore that is used to denote an element E in BEM. Of course such a form must also be validated. In case of an incorrect email address or password the field should receive for example a red frame. Let's call the class responsible for this login form__field invalid. Separated by a double dash the word invalid is a modifier M.
As you can see BEM forces us to follow certain naming patterns. These patterns not only help us maintain modify and easily expand the CSS code but also impose a certain abstraction on the DOM thanks Phone Number List to which our website is not a cluster of "divs" and "spans" but becomes a logical structure with divisions.l be applied for the same specificity. for blocks such as menus toolbars sliders etc. If you are interested in the BEM methodology you will find a lot of materials about BEM in the sources. Summary I believe that maintaining good easy to extend maintain and read CSS code is both an art and a challenge . I hope this article will help you write better CSS code and that organizing your CSS code will no longer be a challenge for you.
Of course I have not exhausted the topic of "polishing" CSS % . I have not touched on the topic of preprocessors and their possibilities such as nesting functions or mixins so I encourage you to leave a comment about what other ways you know to improve the CSS code. Also check out the sources where you can learn more about the issues discussed. Sources and additional material Bootstrap Getting Started CSS Specificity Specificity – Specificity of CSS BEM methodology – thinking style Learn CSS BEM Methodology – components Learn.
As you can see BEM forces us to follow certain naming patterns. These patterns not only help us maintain modify and easily expand the CSS code but also impose a certain abstraction on the DOM thanks Phone Number List to which our website is not a cluster of "divs" and "spans" but becomes a logical structure with divisions.l be applied for the same specificity. for blocks such as menus toolbars sliders etc. If you are interested in the BEM methodology you will find a lot of materials about BEM in the sources. Summary I believe that maintaining good easy to extend maintain and read CSS code is both an art and a challenge . I hope this article will help you write better CSS code and that organizing your CSS code will no longer be a challenge for you.
Of course I have not exhausted the topic of "polishing" CSS % . I have not touched on the topic of preprocessors and their possibilities such as nesting functions or mixins so I encourage you to leave a comment about what other ways you know to improve the CSS code. Also check out the sources where you can learn more about the issues discussed. Sources and additional material Bootstrap Getting Started CSS Specificity Specificity – Specificity of CSS BEM methodology – thinking style Learn CSS BEM Methodology – components Learn.