-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Add a class to all SVG elements on a page #48
Comments
Sorry I missed this. Thanks for adding. |
@Undistraction I'm just being curious here, but do you need to add a class to every SVG? If you were trying to style every SVG couldn't you just style that base class accordingly? At work we use a bastard mutation of SMACSS and ITCSS. The older I get, the more I realize the need for the styling of a reasonable number of base classes. Things like This is where my curiosity comes in... if you're interested in styling every SVG in some consistent way, what's the difference between: svg { width: 100px; height: 100px; } and .svg { width: 100px; height: 100px; } |
@meowsus What happens when you use a third-party lib that does something different from what you're doing? You've now clobbered it by styling the base element. It does make sense to style base elements sometimes, but not with something as specific as dimensions. Some flexible defaults might make sense (for example Actually, even your h1 example is something I avoid. h1-6 have semantic meaning (the importance of the header) but this should be decoupled from the styling as otherwise you bake in the way the header looks with what it means. This might make sense in simple documents, but often not in a complex webpage or application and not on a responsive site where often on mobile, sizes are not indicative of importance. It is also much easier to remove styles by removing a class than by overriding base styles - How can you remove a style on a base element? There are numerous other arguments but I think these are the main ones. |
I see your point. Especially regarding the third-party library. |
I think the rule is that if you are normalising, resetting or setting
defaults, do it on the element (as long as they are genuinely defaults and
you don't end up overriding them everywhere) Otherwise functionality should
be added by classes. The classes should contain as few rules as possible
and you shouldn't be afraid to have many classes on an element.
…On Wed, 31 May 2017, 20:15 Curt Howard, ***@***.***> wrote:
I see your point. Especially regarding the third-party library.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJ20SCAUHDP9ROIKXApEipc95xNf4weks5r_bw0gaJpZM4JyO9c>
.
|
Extendable defaults for all options would be nice, actually. 'aria' and 'nocomment' are things that are generally a good idea to have everywhere. |
Requested in #44 by @Undistraction.
The text was updated successfully, but these errors were encountered: