Skip to content

feat: add data-juice-important attribute#620

Merged
cossssmin merged 1 commit into
masterfrom
feat/data-juice-important
Jun 4, 2026
Merged

feat: add data-juice-important attribute#620
cossssmin merged 1 commit into
masterfrom
feat/data-juice-important

Conversation

@cossssmin

Copy link
Copy Markdown
Collaborator

Summary

Adds a per-element data-juice-important attribute that overrides the global preserveImportant option for a single element.

  • Attribute present (or ="true") preserves !important in that element's inlined declarations, even when the option is off
  • ="false" strips !important, even when the option is on
  • The attribute is removed from the output HTML

Mirrors the existing data-juice-duplicates pattern.

Changes

  • lib/inline.js: resolve the per-element value, store it on the element so the table/dimension attribute helpers respect it too, and strip the attribute from output
  • test/juice.test.js: covers presence, ="true", ="false" overriding the option, and attribute removal
  • README.md: documented under Special markup

@cossssmin cossssmin merged commit 2018277 into master Jun 4, 2026
3 checks passed
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