nicolas-cusan / destyle.css Goto Github PK
View Code? Open in Web Editor NEWOpinionated reset stylesheet that provides a clean slate for styling your html.
Home Page: https://nicolas-cusan.github.io/destyle.css
License: MIT License
Opinionated reset stylesheet that provides a clean slate for styling your html.
Home Page: https://nicolas-cusan.github.io/destyle.css
License: MIT License
destyle's base line-height is 1.15 and this violates the WCAG Success Criterion 1.4.12: Text Spacing.
To suits the criterion, line-height must be "at least 1.5 times the font size".
So, html element's style should be:
html {
line-height: 1.5; /* 1 /
-webkit-text-size-adjust: 100%; / 2 /
-webkit-tap-highlight-color: transparent; / 3*/
}
It seems that in Chrome the default border color is set to gray
. The text color should be inherited.
The declaration font: inherit
on inputs causes the placeholder to be offset from center on Mozilla Firefox
https://codesandbox.io/s/hopeful-meitner-ru143
I noticed an issue with one style rule:
button,
input,
optgroup,
select,
textarea {
...
border: inherit;
...
}
Imagine using one of these elements within any container having a border. It will get inherited which makes no sense.
I would recommend to set it to border: none
or border: 0
.
Hi!
First of all thanks for this small package that I use systematically in all my projects 👍
I've just updated destyle.css
today, and now all my inputs have their borders removed 😭
I've seen that you've changed the selector declaration for input
2 days ago, would it be the reason?
In my browser, I can see that the destyle.css
styles for input
take precedence over my styles (which use classes):
So of course, I'm complaining about the border
, but there are also other properties that are overwritten (border is just the most visibly obvious).
Nice work, however I encountered several issues if what I’m understanding you’re trying to do is right (by removing all styles added by the browser?):
Using iPhone 7 Plus/iOS 12.1.2 on Mobile Safari, there are some elements that still have their default browser styles. Open your test page at
https://nicolas-cusan.github.io/destyle.css/test.html and find the following elements by what’s contained in their content (viewing the source of the page is a challenge without my laptop):
<div>code</div>
I admit many of these use bold, italics, underline, strikethroughs, etc, but if you’re trying to remove ALL browser defaults, those particular elements are not de-styled. Also, if I remember correctly, the canvas
element has a default width and height added by the browser (similar to the iframe
element) and doesn’t do much until you activate it with JavaScript.
I hope these help. :)
While trying out destyle I found some left over paddings. They are small but still.
th
and td
elements(example page from destyle)
option
element(example page html5-kitchen-sink)
I think it would be a good idea to reset the padding
in the universal selector. This way no elements can be missed. Also margin
could be reset like this as well, assuming its equally desired to be reset for all elements. This would also deduplicate quite a bit of code, as right now they are reset individually for every element.
I'm happy to put up an PR if this is accepted.
Default table border color is set to gray
(tested in Chrome), should be set to inherit
or currentColor
.
I want to reset default dialog tag styles.
For example, the following styles are the default for latest chrome.
display: block;
position: absolute;
left: 0px;
right: 0px;
width: -webkit-fit-content;
height: -webkit-fit-content;
color: black;
margin: auto;
border-width: initial;
border-style: solid;
border-color: initial;
border-image: initial;
padding: 1em;
background: white;
I love this repository.
Thank you.
Hello,
Here's a simple template containing :
body
(display: flex
, flex-direction: column
)
header
main
(flex: 1
)footer
destyle.css/destyle.min.css
brands.css/Discord.css
A scrollbar appears, but disappears when either removing the second stylesheet or adding line-height: normal
to body
.
Any idea why ?
Thanks
I added menu{margin: 0; padding: 0;} to my code, because I need it.. What do you think, Nicolas?
Hello,
First of all, I love the way of destyling instead of just normalizing, and I'm quite satisfied with your project, thanks.
However, I have an issue with [contenteditable]
: it remains styled similarly to input[type=text]
.
Thanks !
Hi!
I didn't know where else to write, so I decided here. Is there any way I can contact you by mail? There are some suggestions for improvement.
Hi,
Browsers apply minimal width by default on elements, preventing text wrapping and flex containers to behave properly, requiring the developer to add min-width: 0
.
https://youtube.com/watch?v=cH8VbLM1958
https://defensivecss.dev/tip/flexbox-min-content-size/
https://www.joshwcomeau.com/css/interactive-guide-to-flexbox/
Therefore, it seems it would be a great default for destyle.css to remove these behaviors.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.