This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
☂️ Css Optimizer #1447
c0ncentus
started this conversation in
Suggestions
Replies: 1 comment 3 replies
-
Just so I understood what you are proposing, I try to make a smaller example. Given this CSS/HTML as source code .lorem {
width: 15px;
height: 20px;
}
.ipsum {
width: 15px;
background-color: red;
}
.unused {
display: block;
} <div class="lorem"></div>
<div class="ipsum"></div> What you're saying is that /* auto generated at build time */
.hdfoc {
width: 15px;
}
.lorem {
height: 20px;
}
.ipsum {
background-color: red;
} <div class="hdfoc lorem"></div>
<div class="hdfoc ipsum"></div> Is this what you're proposing? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Because of HTML parser, formatting support and #984 (CSS parser, formatting).
Extremely Short
In my opinion is the best of best of css optimisation
What purpose ?
if you have 100 lines of css maybe nobody cares. But maybe if you want website cool as ever, you do cares .
https://codepen.io/c0ncentus/details/JjbwxdV you can't just let it go with css collision. Even more if you make "js" on "css" with "input:focus" or "input:checked" .
Long Story
I managed a lot of web components into one library with react (full TSX ).
I'am not aware if it is like jsDom or wich level is reach for but imagine if you have 80 000 line of css (like me xD) :
I have always ".xyz_Cpnt" for binding with children for being sure to isolate rules.
Maybe for me is good on "devlopment mode" to have style for each component I use.
But in production what i need is the css used :
Npm in the case have for me the best solution
One classname = one property.
if I look deeply in my code with my 80 000 lines of code and my conviction is maybe 40 000 lines are totally useless because is the same property over and over [some of 20 000 is for lack of optimization] ! 80 000 - 60 000(40K+20K) = 20 000 and maybe ~10 % used on the webPage => ~2000 lines ... The result of my exceptation is 40 times less than my all css code for load css in browser page !
If you know all class on the page you know exacly what you load, that's amazing :) .
Question
Do you think it is possible ?
Do you think it is good issue and on Rome's goal want to achieve ?
Beta Was this translation helpful? Give feedback.
All reactions