-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Reduce compiled css file size #647
Conversation
Upstream main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing this out, it has been fixed a68442a. Please check the cart coupon input https://bootscore.me/cart/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 40761c4, please check the cart. |
Is this comparison with expanded style, or with compressed? Just wondering. Reference: bootscore/inc/scss-compiler.php Lines 51 to 61 in cfbc068
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All seems well.
Had a look to the compiled CSS and file size is big, too big. It's overall 455kb which includes 200kb Bootstrap, 30kb theme and the rest is the WC part. This PR reduces compiled minified CSS to 275kb which is absolute ok compared to other themes.
Figured out that using
@extend
on forms and buttons is a bad idea, because they have all this disabled, focus, focus-within, isvalid, is-invalid etc. states. This states creates in combination with the very bad WC classes huge selector strings which are only visible if you check one of this states. We do not need this states here.Where possible, I readded the filters, but they do not catch all forms and buttons. For the rest i created custom form, custom check/radio with only :focus state and custom buttons with only :hover state and assigned them to the WC classes. This custom components are built with Bootstrap variables. Values can be changed as usual in
_bscore_variables.scss
.The SCSS looks ugly but works and reduces 180kb file size. Tested in on several live shops and works fine, already live on bootscore.me as well.
Test: Check forms, checks and radios in cart, checkout and dashboard. Not each file must be reviewed, viewing the frontend is enough.
PR will have a conflict with #635, but I can fix this later. This one here seems to more important for me.
@justinkruit think this is an serious issue, IYLIMI ;-)
ps. Using
@extend
on other elements like badges or alerts have no negative effect.