Skip to content

Use attribute based scoping instead of classes; small optimizaitons #2

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

Closed
wants to merge 4 commits into from

Conversation

infogulch
Copy link

@infogulch infogulch commented Oct 3, 2023

  • Only support using me. The 'extra flexibility' is unnecessary and distracting. If users want a different selector then they can edit it, it's only 12 lines of code.
  • Use data attributes to identify the parent scope id and select it; this is less likely to interact with existing css tooling and classes, and makes it easier to identify by eye.
  • Combine parent and child scope id assignment and currentScopeId increment, reducing the size of the script by 2 lines.
  • Only creates a parent's scope id once, multiple scoped style children will share the same id.
  • Adjust the regexes to be more selective about what to replace

@infogulch infogulch changed the title Only me; use dataset instead of class based selectors; simplify regex Use attribute based scoping instead of classes; small optimizaitons Oct 4, 2023
@infogulch infogulch closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant