Previous: Modifiers Next: Javascript →

Versioning

Sometimes versioning modules can be helpful when the features of a website evolve over time. For example you may want to A/B test two versions of a module to see what performs better. Or the website might be going through a brand refresh.

When you have multiple versions of a module in your codebase, it can be tempting to again reuse the same HTML and CSS to do this. MaintainableCSS again dictates that you duplicate and provide a unique name to aid maintainability.

/* existing module */
.someModule {}

/* new version of module */
.someModuleVariant2 {}

All you have to do is create two separate modules with a unique module name and you can edit each one independently and in your own time.

Share on Twitter
Previous: Modifiers Next: Javascript →

Chapters

  1. 介绍
  2. 语义化(Semantics)
  3. Reuse
  4. IDs
  5. Conventions
  6. Modules
  7. State
  8. Modifiers
  9. Versioning
  10. Javascript
  11. FAQs