Skip to content
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

Return list of all used classes (for removing unused css) #4

Open
TheJaredWilcurt opened this issue Dec 26, 2021 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@TheJaredWilcurt
Copy link
Member

In order to remove unused CSS, we need to know what CSS gets used!

{
  atomizedHtml: '<div class="frog rp_0 rp_3"></div>',
  markupErrors: [],
  usedClasses: [
    'frog',
    'rp_0',
    'rp_3'
  ]
}
@TheJaredWilcurt TheJaredWilcurt added blocker Prevents other issues from being started enhancement New feature or request and removed blocker Prevents other issues from being started labels Dec 26, 2021
@TheJaredWilcurt
Copy link
Member Author

In order to remove attribute-only selectors ([href] { margin: 0 }) or other non-class-based selectors, we would need to look at every selector in the atomized CSS file, and then detect if it would apply to the markup, and only then retain it (or if it is in the whitelist). Not sure where that code should lie (css, html, or task repo). We may also want to look into pulling in an existing library for removing unused CSS, since it isn't really the main focus of Red Perfume. In which case, based on the API of that library, we could determine what data needs outputted from the Red Perfume libraries.

@TheJaredWilcurt TheJaredWilcurt changed the title Return list of all used classes Return list of all used classes (for removing unused css) Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant