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

Output uglificationMap too #11

Open
TheJaredWilcurt opened this issue Dec 26, 2021 · 0 comments
Open

Output uglificationMap too #11

TheJaredWilcurt opened this issue Dec 26, 2021 · 0 comments

Comments

@TheJaredWilcurt
Copy link
Member

TheJaredWilcurt commented Dec 26, 2021

To perform some logic (like removing duplicate markup classes) other tools will need a reference for what the class names represent.

{
  atomizedCss: '.rp_0 { padding: 8px }',
  classMap: {
    'active': ['rp_0']
  },
  uglificationMap: {
    'rp__0': {
      index: 0,
      usedBy: [
        'active'
      ],
      normal: 'rp__padding__--COLON8px',
      property: 'padding',
      value: '8px'
    },
    // Even if using uglify: false we would still want this, like so:
    'rp__padding__--COLON8px': {
      index: 1,
      usedBy: [
        'active'
      ],
      normal: 'rp__padding__--COLON8px',
      property: 'padding',
      value: '8px'
    }
  }
}

Users could derive specificity by checking the index of each class:

Object.keys(uglificationMap).indexOf('rp__0');

However, this should just be baked in, as a index key to make logic simpler.
When generating these from semantic classes, we can push that semantic class onto the usedBy array. I don't see a use case for this at the moment, however this information may be useful for other tools, and likely won't be difficult to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant