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

[Feat]: Add ability to re-use CSS classes #592

Closed
techfg opened this issue Nov 8, 2023 · 1 comment
Closed

[Feat]: Add ability to re-use CSS classes #592

techfg opened this issue Nov 8, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@techfg
Copy link
Contributor

techfg commented Nov 8, 2023

Description

First off, thank you for your contribution of this library, fantastic stuff and looking forward to v3!

Along that line, I'm currently working on adopting v2 and one thing that would be nice is to have the ability to re-use the CSS classes elsewhere within a site. Unfortunately, many of the styles are tied to element IDs (e.g., #s-bl) making it (theoretically) impossible to re-use (since id's should be unique on a page).

Possibly this approach is necessary but if not, would like to see CSS classes that can be re-used implemented.

The use case is having a Cookie Policy page that contains the exact same table as the Preferences Modal including the same styling. To achieve currently, I'm copy/pasting the CSS to work around but this results in performance impact for pages (larger payload size & processing) in addition to maintenance overhead when new versions are released.

Appreciate your consideration!

Proposed solution

Change (or enhance) CSS selectors from element id's to classes (e.g. #s-bl table might become .cc-s-bl table or #s-bl table, table.cc-ct)

Additional details

No response

@techfg techfg added enhancement New feature or request triage yet to be reviewed labels Nov 8, 2023
@orestbida
Copy link
Owner

Sorry, this won't be worked on.

The id is there to raise the CSS selector specificity/strength so that the style of the plugin is not (easily/unintentionally) overridden by other CSS rules. The other (uglier) option would have been to use the !important directive on all CSS rules.

@orestbida orestbida closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
@orestbida orestbida removed the triage yet to be reviewed label Dec 14, 2023
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
None yet
Development

No branches or pull requests

2 participants