-
Notifications
You must be signed in to change notification settings - Fork 594
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
Added code to check unused CSS Files #1880
Conversation
Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, please review the Newcomers' Guide and sure to join the community Slack. |
✅ Deploy Preview for mesheryio-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@THEBOSS0369, Thanks for your contribution, let's discuss this on the website's call. Please add this as an agenda item to the meeting minutes. |
Hey @Ashparshp I wasn't able to attend the meeting due to travelling. What will i have to do now, like should I move to new issue or wait till this issue get reviewed. I think I should move to new issue, so that i can keep contributing. |
@THEBOSS0369 Changing file names manually can be error-prone and cumbersome. Can you automate it using a script or make a dynamic configuration where file names can be updated whenever there is a need to check for unused css? Also Please make sure your PR passes all required checks before it can be reviewed. |
@THEBOSS0369, sign-off will fix the dco. |
Hey @Ashparshp ! See this my recent commit i added this message |
Hey @shubhusion ! i have never worked with script. so i don't know if i will be able to solve it or not. But i will try to give my best shot. |
5b923e8
to
6d28260
Compare
Signed-off-by: l5io <[email protected]> Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: l5io <[email protected]> Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: l5io <[email protected]> Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: l5io <[email protected]> Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: l5io <[email protected]> Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: l5io <[email protected]> Signed-off-by: THEBOSS0369 <[email protected]>
Signed-off-by: l5io <[email protected]> Signed-off-by: THEBOSS0369 <[email protected]>
6d28260
to
ff7bbc2
Compare
Hey @shubhusion @Ashparshp ! Can you review this PR, so that i can continue contributing further. |
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.
Why did you make so many unrelated changes?
Hey @Ashparshp ! I didn't make those changes, they were made automatically when I was pushing the code it showed that my branch is behind few commits, so i went to my forked repo there was a notification showing 3 commits behind, so I did merge commit and git pull and these changes were done automatically. I didn't make any change in file other than postcss.config.js and check-unused.css |
Hey @Ashparshp can you guide me what to do with this PR? |
@THEBOSS0369, let's discuss this on the website's call. Please add this as an agenda item to the meeting minutes. |
@SAHU-01 // |
@THEBOSS0369 revert the master changed from your pr since you have rebased . Either could be create a new pr. |
@sudhanshutech i have created a new PR #1898 for this issue, this time i just added only 2 files but the files i never added using |
Description
This PR fixes #896
I have added the Purgecss https://purgecss.com/ in the codebase which identifies a particular css/scss file and check html & js files whether the styling is in used or not. I manually checked these particular files adapters.scss, blog.scss, calendar.scss and forms.scss. But was so much time consuming to manually check the files solo so i created this postcss.config.js file.
This PR fixes #
By adding this we can easily check files whether there css styles are in use or not.
Steps to try ->
change this to
'./**/*.html'
to the file you want. for e.g.'./_includes/**/*card.html'
this will check the style of the css file you provided in the particular html file you want. purgecss uses postcss to work.npx postcss _sass/variables.scss -o ./output/variables.css --config ./postcss.config.js
you will have to change
variables.scss
&variables.css
to anything likeheader.scss
&header.css
. As it is using post css which used to check css, so this will convert scss file to css then check. If there will be any error it will be shown otherwise it will return nothing and if there is an unused css style then it will delete that from the particular file.Notes for Reviewers
I found that many of the unused css styles are the ones that are used by pressing or hovering component like a button it has many styles like hovering OR on pressing different styles is used. so its style will be unused until the component is not in used.
Signed commits