Dropbox's opinionated (S)CSS authoring style guide for writing maintainable, scalable, and consistent CSS.
Dropbox CSS Style Guide is an opinionated set of rules and best practices for writing (S)CSS, created by Dropbox for internal use and shared publicly. It provides detailed conventions for formatting, naming (using BEM), architecture (with namespaced classes), and avoiding common pitfalls to ensure CSS is maintainable and scalable across large teams.
Frontend developers and teams working on large-scale web applications who need a consistent, battle-tested approach to writing CSS that remains manageable over time.
It offers a comprehensive, production-tested style guide from a major tech company, helping teams enforce consistency, reduce CSS debt, and improve collaboration through clear conventions and anti-pattern avoidance.
Dropbox’s (S)CSS authoring style guide
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Defines precise spacing, indentation, and code organization, such as four spaces for indenting and one line per property, ensuring consistency across large teams as detailed in the 'Spacing' and 'Formatting' sections.
Recommends BEM for class naming with clear examples like '.alert-box__close' and '.expanding-section--expanded', facilitating predictable and maintainable CSS architecture in large projects.
Uses prefixes like '.o-' for objects, '.c-' for components, and '.u-' for utilities, as outlined in the 'Namespaced Classes' section, to clarify purpose and prevent conflicts in codebases.
Specifies a logical order for CSS properties, from layout to pseudo-selectors, improving readability and reducing cognitive load, with examples provided in the 'Rule Ordering' section.
Strict prohibitions like avoiding 'margin-top' and shorthand properties, as stated in the 'Don'ts' section, can be limiting and may not align with all development styles or project needs.
Heavily relies on Sass features like variables and nesting, making it less suitable for teams using plain CSS or other preprocessors, with minimal guidance for non-Sass environments.
Does not address integrations with modern JavaScript frameworks or CSS-in-JS solutions, focusing solely on traditional Sass/SCSS, which may require additional adaptation for contemporary web development.