Comments (3)
Howdy @felguerez! The frontend framework that we use internally does a mix of both. For very common typographic elements like p
and h1–6
tags we apply styles directly with an element selector. For certain of these we define a utility class to match. For example:
h1,
.h1 {
// font-size, line-height, etc
}
For styles that can plausibly be applied to any element, we stick with a utility class, like this:
.text-lead {
font-size: 16px;
}
There's no right answer here, but a general rule of thumb might be: implement utility classes for the exceptions, and otherwise leverage global styles for commonly reused elements. If your design is consistent this should be fairly easy. It doesn't make sense, for example, to add .text-body
to every p
tag if 95% of them use that class.
Does that answer your question?
from css.
It does indeed. Thanks Mike. Your rule of thumb is generally the direction we're taking at my org. I appreciate your feedback!
from css.
You're quite welcome!
from css.
Related Issues (20)
- :)
- Css
- yarn lint warning about deprecated rule
- stylelint-config-airbnb is causing issues with npm for dependency resolution HOT 1
- [spam]
- Rule: declaration-property-value-blacklist no longer exists with Stylelint 14.x HOT 1
- How can I add transition in <details> HOT 1
- Wla
- css
- [spam]
- CSS
- [spam]
- [spam]
- [spam]
- [spam]
- [spam]
- [spam]
- Translate to Hindi HOT 5
- CSS
- Css
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from css.