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

chore(deps): update dependency lightningcss to v1.24.0 #3418

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 23, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
lightningcss 1.23.0 -> 1.24.0 age adoption passing confidence

Release Notes

parcel-bundler/lightningcss (lightningcss)

v1.24.0

Compare Source

This release adds support the the light-dark() color function, parses CSS system colors, deduplicates custom properties during minification, merges duplicates @keyframes rules, and fixes some bugs.

light-dark()

The light-dark() function allows you to specify a light mode and dark mode color in a single declaration, without needing to write a separate media query rule. In addition, it uses the color-scheme property to control which theme to use, which allows you to set it programmatically. The color-scheme property also inherits so themes can be nested and the nearest ancestor color scheme applies.

Lightning CSS converts the light-dark() function to use CSS variable fallback when your browser targets don't support it natively. For this to work, you must set the color-scheme property on an ancestor element. The following example shows how you can support both operating system and programmatic overrides for the color scheme.

html {
  color-scheme: light dark;
}

html[data-theme=light] {
  color-scheme: light;
}

html[data-theme=dark] {
  color-scheme: dark;
}

button {
  background: light-dark(#aaa, #​444);
}

compiles to:

html {
  --lightningcss-light: initial;
  --lightningcss-dark: ;
  color-scheme: light dark;
}

@​media (prefers-color-scheme: dark) {
  html {
    --lightningcss-light: ;
    --lightningcss-dark: initial;
  }
}

html[data-theme="light"] {
  --lightningcss-light: initial;
  --lightningcss-dark: ;
  color-scheme: light;
}

html[data-theme="dark"] {
  --lightningcss-light: ;
  --lightningcss-dark: initial;
  color-scheme: dark;
}

button {
  background: var(--lightningcss-light, #aaa) var(--lightningcss-dark, #​444);
}

Check it out in the playground.

CSS system colors

CSS system colors are now supported during parsing, meaning they can be safely deduplicated when merging rules.

.a {
  background: Highlight;
}

.a {
  background: ButtonText;
}

compiles to:

.a{background:buttontext}

Custom property deduplication

CSS custom properties are now deduplicated when merging rules. The last property value always wins.

.a {
  --foo: red;
}

.a {
  --foo: green;
}

minifies to:

.a{--foo:green}

@keyframes deduplication

@keyframes rules are also now deduplicated during minification. The last rule of the same name wins.

@​keyframes a {
  from { opacity: 0 }
  to { opacity: 1 }
}

@​keyframes a {
  from { color: red }
  to { color: blue }
}

compiles to:

@​keyframes a{0%{color:red}to{color:#​00f}}

Other bug fixes


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

Copy link

cloudflare-workers-and-pages bot commented Feb 23, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5ececae
Status:⚡️  Build in progress...

View logs

@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from b4dcbc1 to 0fa67bc Compare February 26, 2024 03:15
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch 2 times, most recently from efeca57 to 7ea2df4 Compare March 13, 2024 16:33
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from 7ea2df4 to 5ececae Compare March 13, 2024 16:36
@Bnyro Bnyro merged commit 50f1460 into master Mar 13, 2024
4 of 5 checks passed
@Bnyro Bnyro deleted the renovate/lightningcss-1.x branch March 13, 2024 16:37
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