Skip to content

Commit

Permalink
chore: Update sass and change colour syntax (videojs#8894)
Browse files Browse the repository at this point in the history
## Description
Projects using newer versions of sass which have deprecated `lighten()`
will get deprecation warnings.

This updates sass, and switches to `color.adjust()`. This function is
available since dart sass 1.23.0.

Note this would increase the output CSS size, as it will output
different colour syntax, .e.g.

```
<   background-image: linear-gradient(-180deg, #fff 88%, rgb(114.9141509434, 132.7028301887, 159.3858490566) 100%);
---
>   background-image: linear-gradient(-180deg, #fff 88%, #73859f 100%);
```

Closes videojs#8876

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser (Chrome, Firefox,
IE)
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors
  • Loading branch information
mister-ben authored Feb 5, 2025
1 parent 4661aa7 commit 55bb0fd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
25 changes: 21 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-stub": "^1.2.0",
"rollup-plugin-svg": "^2.0.0",
"sass": "^1.34.0",
"sass": "^1.79.3",
"semver": "^5.7.0",
"shelljs": "^0.8.5",
"shx": "^0.3.2",
Expand Down
4 changes: 3 additions & 1 deletion src/css/_private-variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:color";

// Text, icons, hover states
$primary-foreground-color: #fff !default;

Expand All @@ -6,7 +8,7 @@ $primary-background-color: #2B333F !default;
$primary-background-transparency: 0.7 !default;

// Hover states, slider backgrounds
$secondary-background-color: lighten($primary-background-color, 33%) !default;
$secondary-background-color: color.adjust($primary-background-color, $lightness: 33%, $space: hsl) !default;
$secondary-background-transparency: 0.5 !default;

// Avoiding helvetica: issue #376
Expand Down

0 comments on commit 55bb0fd

Please sign in to comment.