Giter Club home page Giter Club logo

css-modules-subcomponents-and-modifiers-collection's Introduction

CSS Modules, Subcomponents, and Modifiers Collection

A collection of common CSS module, subcomponent, and modifier class names from around the web.

What are CSS modules, subcomponents, and modifiers?

Recently I've been researching SMACSS by Johnathan Snook and the BEM Methodology by Yandex as well as examing my own style of crafting CSS. I've started adopting an approach based on SMACSS that uses the Base, Layout, Module, State approach for structuring my CSS, though I'ved expanded on the concept of modules based on my research into the BEM methodolgy. I've started using a pattern which I refer to it as Module, Subcomponent, Modifier.

Modules

The concept of modules is the same concept of modules described in SMACSS. So if your fimiliar with SMACSS, you already know what modules are. A few examples of modules that come to mind are things like:

.nav, .alert, .btn, .modal

Subcomponents

Subcomponents are the inside parts of a module, if it has any. They make up the module. For example, with a .modal module you might have the following components:

.modal-header, .modal-body, .modal-footer

Another example would be a .post module. With it, you have to following components:

.post-title, .post-date, .post-author, .post-thumb, .post-entry, etc.

Modifiers

Again, if you are familiar with SMACSS, you already know what modifiers are. Snook refers to them submodules, though after reading over the BEM methodolgy, I prefer to call these modifiers. The concept is simple, we use modifiers to modify instances of a module. Some examples of modifiers are things like

--bread-crumbs, --success, --submit

Modifiers are added onto modules to expand their basic functionality for specific cases.

Examples of the above modifiers in use would look like:

.nav--breadcrumbs, .alert--success, .btn--submit

What is this repo?

This repo is simply a collection of common module names, component names, and modifier names from around the web. I believe naming things is one of the hardest parts of coding. How you style the elements is up to you, though I thought it would be nice to come up with a collection of common/popular HTML class names for modules, components, and modifiers to help create more standardization in my projects.

More thoughts on HTML Class naming conventions.

I've jotted down some thoughts on HTML Class naming conventions on my blog. Have a certain way you name your modules, subcomponents, and modifiers? Let me know.

Credit

css-modules-subcomponents-and-modifiers-collection's People

Contributors

bjankord avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.