This content originally appeared on CSS-Tricks and was authored by Chris Coyier
CSS overrides can change the default look of almost anything:
- You can use CSS to override what a checkbox or radio button looks like, but if you don’t, the checkbox will look like a default checkbox on your operating system and some would say that’s best for accessibility and usability.
- You can use CSS to override what a select menu looks like, but if you don’t, the select will look like a default select menu on your operating system and some would say that’s best for accessibility and usability.
- You can override what anchor links look like, but some would say they should be blue with underlines because that is the default and it’s best for accessibility and usability.
- You can override what scrollbars look like, but if you don’t, the scrollbars will look (and behave) the way default scrollbars do on your operating system, and some would say that’s best for accessibility and usability.
It just goes on and on…
- You can customize what a button looks like, but…
- You can customize what the cursor looks like, or particular elements on your site, but…
- You can change the text highlighting color, you can change the accent color, heck, soon you’ll be able to customize what spelling and grammer mistakes look like in editable text areas, but…
Where do you draw the line?
In my experience, everyone has a different line. Nearly everybody styles their buttons. Nearly everybody styles their links, but some might only customize the hue of blue and leave the underline, drawing the line at more elaborate changes. It’s fairly popular to style form elements like checkboxes, radio buttons, and selects, but some people draw the line before that.
Some people draw a line saying you should never change a default cursor, some push that line back to make the cursor into a pointer for created interactive elements, some push that line so far they are OK with custom images as cursors. Some people draw the line with scrollbars saying they should never be customized, while some people implement elaborate designs.
CSS is a language for changing the design of websites. Every ruleset you write likely changes the defaults of something. The lines are relatively fuzzy, but I’d say there is nothing in CSS that should be outright banned from use — it’s more about the styling choices you make. So when you do choose to style something, it remains usable and accessible. Heck, background-color
can be terribly abused making for inaccessible and unusable areas of a site, but nobody raises pitchforks over that.
Should CSS Override Default Browser Styles? originally published on CSS-Tricks
This content originally appeared on CSS-Tricks and was authored by Chris Coyier
Chris Coyier | Sciencx (2022-01-04T19:50:18+00:00) Should CSS Override Default Browser Styles?. Retrieved from https://www.scien.cx/2022/01/04/should-css-override-default-browser-styles/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.