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.25.1 #999

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 4, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
lightningcss 1.22.1 -> 1.25.1 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

parcel-bundler/lightningcss (lightningcss)

v1.25.1

Compare Source

Fixes a property ordering bug when using the all shorthand.

v1.25.0

Compare Source

This release adds more granular options for CSS modules, implements some new CSS properties, and fixes bugs.

Added
  • Add granular options to control which identifiers are scoped in CSS modules. You can turn off scoping for grid, animation, and custom_idents. This may be useful when migrating from other tools. See docs. Thanks @​timneutkens! 83839a9
  • Optimize the all shorthand property to reset other properties except direction and unicode-bidi. d7aeff3
  • Implement animation-timeline property and add support for it in the animation shorthand f4408c7
Fixed
  • Prevent simplifying translate: none and scale: none which are distinct from translate: 0 and scale: 1. Thanks @​RobinMalfait! a4cc024
  • Fix crash on box-shadow with currentColor keyword. Thanks @​magic-akari! 06ba62f
  • Fix minifier removing zero channels in color() function to follow spec change 445def9
  • Fix CSS module scoping with variables in animation shorthand fb4b334
  • Update browser compatibility data ec9da43

v1.24.1

Compare Source

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

v1.23.0

Compare Source

This release improves minification for @layer and @property rules, enables relative colors to be compiled in more situations, adds new functionality for custom visitor plugins, and fixes some bugs.

Downlevel relative colors with unknown alpha

Lightning CSS can now down level relative colors where the alpha value is unknown (e.g. a variable). For example:

.foo {
  color: hsl(from yellow h s l / var(--alpha));
}

becomes:

.foo {
  color: hsla(60, 100%, 50%, var(--alpha));
}
Optimized @layer rules

@layer rules with the same name are now merged together and ordered following their original declared order. For example:

@​layer a, b;

@​layer b {
  .foo { color: red }
}

@​layer a {
  .foo { background: yellow }
}

@​layer b {
  .bar { color: red }
}

becomes:

@​layer a {
  .foo { background: yellow }
}

@​layer b {
  .foo, .bar { color: red }
}
Deduped @property rules

@property rules are now deduplicated when they define the same property name. The last rule wins.

@​property --property-name {
  syntax: '<color>';
  inherits: false;
  initial-value: yellow;
}
.foo {
  color: var(--property-name)
}
@&#8203;property --property-name {
  syntax: '<color>';
  inherits: true;
  initial-value: blue;
}

compiles to:

@&#8203;property --property-name{
  syntax: "<color>";
  inherits: true;
  initial-value: #&#8203;00f
}

.foo {
  color: var(--property-name)
}
StyleSheet visitor function

The JS visitor API now supports StyleSheet and StyleSheetExit visitors, allowing you to visit the entire stylesheet at once. This enables things like rule sorting or appending/prepending rules.

let res = transform({
  filename: 'test.css',
  minify: true,
  code: Buffer.from(`
    .foo {
      width: 32px;
    }

    .bar {
      width: 80px;
    }
  `),
  visitor: {
    StyleSheetExit(stylesheet) {
      stylesheet.rules.sort((a, b) => a.value.selectors[0][0].name.localeCompare(b.value.selectors[0][0].name));
      return stylesheet;
    }
  }
});

assert.equal(res.code.toString(), '.bar{width:80px}.foo{width:32px}');

Keep in mind that visiting the entire stylesheet can be expensive, due to needing to serialize and deserialize the entire AST to send between Rust and JavaScript. Keep visitors as granular as you can to avoid this.

Other bug fixes
  • Fixed serializing grid-auto-flow in custom visitors
  • Fixed compatibility data for -webkit-fill-available and -moz-available size values
  • Added support for CommonJS in WASM package
  • Allowed whitespace or nothing in initial-value of @property rules
  • Fixed AST TypeScript types to have correct types for duplicated names

Configuration

📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday" (UTC), 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.

@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch 9 times, most recently from bd92a8d to 8caa0e2 Compare March 10, 2024 12:02
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from 8caa0e2 to 75778f4 Compare March 15, 2024 04:55
@renovate renovate bot changed the title chore(deps): update dependency lightningcss to v1.24.0 chore(deps): update dependency lightningcss to v1.24.1 Mar 15, 2024
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch 3 times, most recently from 8da3700 to 4231894 Compare March 17, 2024 09:24
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch 2 times, most recently from 408ca95 to 58aa115 Compare April 19, 2024 12:29
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from 58aa115 to 19996b3 Compare April 27, 2024 14:04
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from 19996b3 to 0c9c30e Compare May 18, 2024 01:13
@renovate renovate bot changed the title chore(deps): update dependency lightningcss to v1.24.1 chore(deps): update dependency lightningcss to v1.25.0 May 18, 2024
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from 0c9c30e to db40e14 Compare May 25, 2024 06:25
@renovate renovate bot changed the title chore(deps): update dependency lightningcss to v1.25.0 chore(deps): update dependency lightningcss to v1.25.1 May 25, 2024
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch 3 times, most recently from 4d2425a to 29f6be1 Compare May 29, 2024 17:19
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from 29f6be1 to b1ee75f Compare May 31, 2024 07:51
Copy link
Contributor Author

renovate bot commented Jun 1, 2024

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (1.25.1). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/lightningcss-1.x branch June 1, 2024 16:01
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.

None yet

1 participant