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

First draft, color space announcement #1170

Merged
merged 56 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7c1a4ce
Bump rollup from 4.18.0 to 4.19.0 (#1119)
dependabot[bot] Jul 22, 2024
1179f04
Bump @types/lodash from 4.17.5 to 4.17.7 (#1118)
dependabot[bot] Jul 22, 2024
cd3f3f0
Bump @typescript-eslint/eslint-plugin from 7.16.0 to 7.17.0 (#1117)
dependabot[bot] Jul 22, 2024
405e43e
Bump @babel/core from 7.24.7 to 7.24.9 (#1110)
dependabot[bot] Jul 22, 2024
6159757
Bump @babel/preset-env from 7.24.7 to 7.24.8 (#1109)
dependabot[bot] Jul 22, 2024
d3aabb9
Add a blog post indicating that Node Sass is end-of-life (#1120)
nex3 Jul 24, 2024
d68caec
Link to the CSSWG thread on mixed decls (#1113)
nex3 Jul 25, 2024
df2317a
Document Embedded Dart Sass (#1121)
nex3 Jul 26, 2024
724242a
Bump @typescript-eslint/eslint-plugin from 7.17.0 to 7.18.0 (#1127)
dependabot[bot] Jul 29, 2024
c323f02
Bump @types/markdown-it from 14.1.1 to 14.1.2 (#1126)
dependabot[bot] Jul 29, 2024
a4eab7b
Bump typescript from 5.4.5 to 5.5.4 (#1123)
dependabot[bot] Jul 29, 2024
2d4991a
Bump @babel/preset-env from 7.24.8 to 7.25.0 (#1124)
dependabot[bot] Jul 29, 2024
57745ef
Bump semver from 7.6.2 to 7.6.3 (#1125)
dependabot[bot] Jul 30, 2024
d5af2c5
Add mixed-decls.md breaking change to the breaking changes index (#1128)
Goodwine Jul 31, 2024
2d6ac2e
Fix link reference (#1129)
ntkme Aug 5, 2024
e9747f6
Bump prettier from 3.3.2 to 3.3.3 (#1134)
dependabot[bot] Aug 6, 2024
17f92ac
Bump rollup from 4.19.0 to 4.20.0 (#1133)
dependabot[bot] Aug 6, 2024
2def2c8
Bump @babel/preset-env from 7.25.0 to 7.25.3 (#1132)
dependabot[bot] Aug 6, 2024
b201e7b
Bump jquery-ui from 1.13.3 to 1.14.0 (#1130)
dependabot[bot] Aug 6, 2024
0acfc82
Bump @typescript-eslint/eslint-plugin from 7.18.0 to 8.0.1 (#1131)
dependabot[bot] Aug 6, 2024
da0841c
Fix grammatical error in syntax/index.md (#1142)
getsnoopy Aug 16, 2024
9de346a
Bump @11ty/eleventy-plugin-rss from 2.0.1 to 2.0.2 (#1141)
dependabot[bot] Aug 19, 2024
5ab8028
Bump eslint-plugin-prettier from 5.1.3 to 5.2.1 (#1139)
dependabot[bot] Aug 19, 2024
9b99927
Bump @typescript-eslint/eslint-plugin from 8.0.1 to 8.1.0 (#1138)
dependabot[bot] Aug 19, 2024
fbc4170
Bump immutable from 4.3.6 to 4.3.7 (#1137)
dependabot[bot] Aug 19, 2024
374e59e
Bump truncate-html from 1.1.1 to 1.1.2 (#1147)
dependabot[bot] Aug 21, 2024
12ac816
Bump rollup from 4.20.0 to 4.21.0 (#1145)
dependabot[bot] Aug 21, 2024
c2c5a9c
Bump @typescript-eslint/eslint-plugin from 8.1.0 to 8.2.0 (#1144)
dependabot[bot] Aug 21, 2024
470d4d0
Bump liquidjs from 10.14.0 to 10.16.3 (#1146)
dependabot[bot] Aug 21, 2024
ec99237
Fix brace error in forward documentation (#1149)
nickedelenbos Aug 22, 2024
2856181
Bump liquidjs from 10.16.3 to 10.16.4 (#1157)
dependabot[bot] Aug 26, 2024
7248af0
Bump @babel/preset-env from 7.25.3 to 7.25.4 (#1154)
dependabot[bot] Aug 26, 2024
2df4a2a
Bump rollup from 4.21.0 to 4.21.1 (#1155)
dependabot[bot] Aug 26, 2024
7762303
Bump markdown-it-anchor from 9.0.1 to 9.1.0 (#1156)
dependabot[bot] Aug 26, 2024
ed7646c
Bump @types/jqueryui from 1.12.22 to 1.12.23 (#1158)
dependabot[bot] Aug 26, 2024
4a7085b
Bump @babel/core from 7.24.9 to 7.25.2 (#1163)
dependabot[bot] Sep 3, 2024
f6dabbc
Bump liquidjs from 10.16.4 to 10.16.7 (#1162)
dependabot[bot] Sep 3, 2024
7dd41bc
Bump rollup from 4.21.1 to 4.21.2 (#1161)
dependabot[bot] Sep 3, 2024
96b9dfc
Bump @types/node from 16.18.101 to 16.18.106 (#1160)
dependabot[bot] Sep 3, 2024
51f38d5
Bump @typescript-eslint/eslint-plugin from 8.2.0 to 8.4.0 (#1159)
dependabot[bot] Sep 3, 2024
85bddda
Cut a release for a new Dart Sass version
sassbot Sep 3, 2024
795bb50
Document the `meta.feature-exists` deprecation (#1148)
nex3 Sep 4, 2024
7b13797
[Playground] Default code contents, Indented formatting (#1164)
jamesnw Sep 5, 2024
4fad520
Use the same TypeScript style as other Sass packages (#1165)
nex3 Sep 5, 2024
a49d459
Re-enable eslint for source/assets/js (#1168)
nex3 Sep 6, 2024
753dee8
First draft, color space announcement
mirisuzanne Sep 9, 2024
acabf7f
Include srgb images
mirisuzanne Sep 9, 2024
0e38157
Finalize images
mirisuzanne Sep 9, 2024
3d6f27e
Merge branch 'color-4' into color-space-post
mirisuzanne Sep 12, 2024
45e3a84
Apply suggestions from code review
mirisuzanne Sep 12, 2024
87188ec
Address specific review comments
mirisuzanne Sep 12, 2024
74caadc
Include skip-to-features link
mirisuzanne Sep 12, 2024
946e742
All examples in example syntax
mirisuzanne Sep 12, 2024
01c8036
Sneaky semi-colons trying to mess up my post
mirisuzanne Sep 12, 2024
ba39578
Use 0% saturation, and consistent gray spelling
mirisuzanne Sep 12, 2024
e48db0e
Update source/blog/042-wide-gamut-colors-in-sass.md
mirisuzanne Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/source/assets/sass/vendor/
/source/blog/*.md
/source/documentation/js-api
/source/assets/js
coverage/
node_modules/
package-lock.json
Expand Down
10 changes: 1 addition & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
{
"extends": "./node_modules/gts/",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021
},
"rules": {
"node/no-unpublished-import": "off",
"node/no-unpublished-require": "off"
}
"extends": "./node_modules/gts/"
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint:ci
run: npm run check

release:
name: Deploy
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ You can also run individual commands:
npm run build

# format and lint all files
npm run lint
npm run fix
```

## Templates
Expand Down
3,577 changes: 2,248 additions & 1,329 deletions package-lock.json

Large diffs are not rendered by default.

61 changes: 34 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,33 @@
"build:typedoc": "./tool/typedoc-build.sh",
"build:11ty": "NODE_OPTIONS='-r ts-node/register' eleventy",
"watch:11ty": "npm run build:11ty -- --serve --incremental",
"tsc": "tsc",
"gts": "gts fix",
"gts:ci": "gts lint",
"prettier": "prettier --write '**/*.{json,yml,scss}'",
"prettier:ci": "prettier --check '**/*.{json,yml,scss}'",
"stylelint": "stylelint 'source/assets/sass/*.{css,scss}' --fix",
"stylelint:ci": "stylelint 'source/assets/sass/*.{css,scss}'",
"lint": "run-s prettier gts stylelint tsc",
"lint:ci": "run-s prettier:ci gts:ci stylelint:ci tsc",
"check": "run-s check:gts check:tsc check:stylelint",
"check:gts": "gts check",
"check:stylelint": "stylelint 'source/assets/sass/*.{css,scss}'",
"check:tsc": "tsc --noEmit",
"fix": "run-s fix:gts fix:stylelint",
"fix:gts": "gts fix",
"fix:stylelint": "stylelint 'source/assets/sass/*.{css,scss}' --fix",
"test": "echo \"Error: no test specified\" && exit 1",
"checklinks:internal": "npx --yes --package=hyperlink -- 'hyperlink --canonicalroot https://sass-lang.com/ --root _site/ -r -p -i --skip \"fragment-redirect\" --skip \"types.Map\" _site/index.html'",
"checklinks:external": "npx --yes --package=broken-link-checker -- 'blc -ro --exclude=twitter.com --exclude=mvnrepository.com --exclude=drupal.org --exclude=web.archive.org https://sass-lang.com'"
},
"devDependencies": {
"@11ty/eleventy": "^2.0.1",
"@11ty/eleventy-plugin-rss": "^2.0.1",
"@11ty/eleventy-plugin-rss": "^2.0.2",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"@babel/preset-typescript": "^7.24.7",
"@codemirror/autocomplete": "^6.18.0",
"@codemirror/commands": "^6.6.1",
"@codemirror/lang-css": "^6.2.1",
"@codemirror/lang-sass": "^6.0.2",
"@codemirror/language": "^6.10.2",
"@codemirror/lint": "^6.8.1",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.33.0",
"@lezer/highlight": "^1.2.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-inject": "^5.0.5",
Expand All @@ -55,48 +61,49 @@
"@sindresorhus/slugify": "^1.1.2",
"@types/deep-equal": "^1.0.4",
"@types/jquery": "^3.5.30",
"@types/jqueryui": "^1.12.22",
"@types/lodash": "^4.17.5",
"@types/markdown-it": "^14.1.1",
"@types/jqueryui": "^1.12.23",
"@types/lodash": "^4.17.7",
"@types/markdown-it": "^14.1.2",
"@types/markdown-it-attrs": "^4.1.3",
"@types/markdown-it-footnote": "^3.0.4",
"@types/node": "^16",
"@types/pako": "^2.0.3",
"@types/prismjs": "^1.26.4",
"@types/seedrandom": "^3.0.8",
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"cheerio": "^1.0.0-rc.12",
"codemirror": "^6.0.1",
"date-fns": "^3.6.0",
"deep-equal": "^2.2.3",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-prettier": "^5.2.1",
"gts": "^5.3.1",
"immutable": "^4.3.6",
"immutable": "^4.3.7",
"jquery": "^3.7.1",
"jquery-ui": "^1.13.3",
"jquery-ui": "^1.14.0",
"js-yaml": "^4.1.0",
"kleur": "^4.1.5",
"liquidjs": "^10.14.0",
"liquidjs": "^10.16.7",
"lodash": "^4.17.21",
"lorem-ipsum": "^2.0.8",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^9.0.1",
"markdown-it-anchor": "^9.1.0",
"markdown-it-attrs": "^4.1.6",
"markdown-it-deflist": "^3.0.0",
"markdown-it-footnote": "^4.0.0",
"netlify-plugin-11ty": "^1.4.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.3.2",
"prettier": "^3.3.3",
"prismjs": "^1.29.0",
"rollup": "^4.18.0",
"sass": "^1.77.8",
"semver": "^7.6.2",
"rollup": "^4.21.2",
"sass": "^1.78.0",
"semver": "^7.6.3",
"stylelint": "^15.11.0",
"stylelint-config-standard-scss": "^11.1.0",
"truncate-html": "^1.1.1",
"truncate-html": "^1.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"typescript": "^5.5.4",
"typogr": "^0.6.8"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions source/_data/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ toc:
- abs() Percentage: /documentation/breaking-changes/abs-percent/
- Functions and Mixins Beginning with <code>--</code>: /documentation/breaking-changes/css-function-mixin/
- Mixed Declarations: /documentation/breaking-changes/mixed-decls/
- <code>meta.feature-exists</code>: /documentation/breaking-changes/feature-exists/
- Command Line: /documentation/cli/
:children:
- Dart Sass: /documentation/cli/dart-sass/
Expand Down
123 changes: 67 additions & 56 deletions source/_data/redirects.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,74 @@
import * as fs from 'fs';
import * as p from 'path';

/** Returns `path` without any file extensions. */
function withoutExtensions(path: string): string {
return path.substring(0, path.indexOf('.'));
}

module.exports = {
breaking: fs
.readdirSync(p.join(__dirname, '../documentation/breaking-changes'))
.filter(path => path.endsWith('.md'))
.map(path => withoutExtensions(p.basename(path))),
multiple: [
{
from: [
'/d/random-with-units',
'/documentation/breaking-changes/random-with-units',
'/d/color-units',
'/documentation/breaking-changes/color-units',
],
to: '/documentation/breaking-changes/function-units',
},
{
from: [
'/docs/yardoc/file.SASS_REFERENCE.html',
'/documentation/file.SASS_REFERENCE.html',
],
to: '/documentation',
},
{
from: [
'/docs/yardoc/file.SASS_CHANGELOG.html',
'/documentation/file.SASS_CHANGELOG.html',
],
to: 'https://github.com/sass/dart-sass/blob/main/CHANGELOG.md',
},
{
from: [
'/docs/yardoc/file.INDENTED_SYNTAX.html',
'/documentation/file.INDENTED_SYNTAX.html',
'/docs/yardoc/file.SCSS_FOR_SASS_USERS.html',
'/documentation/file.SCSS_FOR_SASS_USERS.html',
],
to: '/documentation/syntax',
},
{
from: [
'/docs/yardoc/Sass/Script/Functions.html',
'/documentation/Sass/Script/Functions.html',
'/docs/yardoc/functions.html',
'/documentation/functions.html',
],
to: '/documentation/modules',
},
{
from: [
'/docs/yardoc/functions/css.html',
'/documentation/functions/css.html',
],
to: '/documentation/at-rules/function/#plain-css-functions',
},
],
};
/** A list of breaking change URLs. */
export const breaking: string[] = fs
.readdirSync(p.join(__dirname, '../documentation/breaking-changes'))
.filter(path => path.endsWith('.md'))
.map(path => withoutExtensions(p.basename(path)));

/** A set of redirects from multiple sources to one target. */
export interface MultipleRedirect {
/** The source URLs that should redirect to `to`. */
from: string[];

/** The URL to redirect to. */
to: string;
}

/** A list of redirects from mmultiple sources to single targets. */
export const multiple: MultipleRedirect[] = [
{
from: [
'/d/random-with-units',
'/documentation/breaking-changes/random-with-units',
'/d/color-units',
'/documentation/breaking-changes/color-units',
],
to: '/documentation/breaking-changes/function-units',
},
{
from: [
'/docs/yardoc/file.SASS_REFERENCE.html',
'/documentation/file.SASS_REFERENCE.html',
],
to: '/documentation',
},
{
from: [
'/docs/yardoc/file.SASS_CHANGELOG.html',
'/documentation/file.SASS_CHANGELOG.html',
],
to: 'https://github.com/sass/dart-sass/blob/main/CHANGELOG.md',
},
{
from: [
'/docs/yardoc/file.INDENTED_SYNTAX.html',
'/documentation/file.INDENTED_SYNTAX.html',
'/docs/yardoc/file.SCSS_FOR_SASS_USERS.html',
'/documentation/file.SCSS_FOR_SASS_USERS.html',
],
to: '/documentation/syntax',
},
{
from: [
'/docs/yardoc/Sass/Script/Functions.html',
'/documentation/Sass/Script/Functions.html',
'/docs/yardoc/functions.html',
'/documentation/functions.html',
],
to: '/documentation/modules',
},
{
from: [
'/docs/yardoc/functions/css.html',
'/documentation/functions/css.html',
],
to: '/documentation/at-rules/function/#plain-css-functions',
},
];
37 changes: 23 additions & 14 deletions source/_data/releases.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import {spawn as nodeSpawn, SpawnOptionsWithoutStdio} from 'node:child_process';
import {SpawnOptionsWithoutStdio, spawn as nodeSpawn} from 'node:child_process';
import fs from 'node:fs/promises';

import deepEqual from 'deep-equal';
import kleur from 'kleur';
import {compare, parse} from 'semver';

/** A release of a version of Sass. */
export interface Release {
/** The version of this Sass release. */
version: string;

/** The URL for this version. */
url: string;
}

type VersionCache = Record<string, string>;

const VERSION_CACHE_PATH = './source/_data/versionCache.json';
Expand All @@ -13,11 +22,11 @@ const VERSION_CACHE_PATH = './source/_data/versionCache.json';
* Promise version of `spawn` to avoid blocking the main thread while waiting
* for the child processes.
*/
const spawn = (
function spawn(
cmd: string,
args: string[],
options: SpawnOptionsWithoutStdio
) => {
): Promise<string> {
return new Promise((resolve, reject) => {
const child = nodeSpawn(cmd, args, options);
const stderr: string[] = [];
Expand All @@ -36,12 +45,12 @@ const spawn = (
}
});
});
};
}

/**
* Retrieves cached version object from cache file.
*/
const getCacheFile = async () => {
async function getCacheFile(): Promise<VersionCache> {
let versionCache;
try {
const versionFile = await fs.readFile(VERSION_CACHE_PATH);
Expand All @@ -54,20 +63,20 @@ const getCacheFile = async () => {
}
}
return versionCache;
};
}

/**
* Writes version object to cache file.
*/
const writeCacheFile = async (cache: VersionCache) => {
async function writeCacheFile(cache: VersionCache): Promise<void> {
console.info(kleur.green('[11ty] Writing version cache file...'));
await fs.writeFile(VERSION_CACHE_PATH, JSON.stringify(cache));
};
}

/**
* Retrieves the highest stable version of `repo`, based on its git tags.
*/
const getLatestVersion = async (repo: string) => {
async function getLatestVersion(repo: string): Promise<string> {
console.info(kleur.cyan(`[11ty] Fetching version information for ${repo}`));
let stdout;
try {
Expand All @@ -80,10 +89,10 @@ const getLatestVersion = async (repo: string) => {
console.error(kleur.red(`[11ty] Failed to fetch git tags for ${repo}`));
throw err;
}
const isNotPreRelease = (version: string) => {
function isNotPreRelease(version: string): boolean | null {
const parsed = parse(version);
return parsed && parsed.prerelease.length === 0;
};
}
const version = stdout
.split('\n')
.map(line => line.split('refs/tags/').at(-1) ?? '')
Expand All @@ -92,12 +101,12 @@ const getLatestVersion = async (repo: string) => {
.at(-1);

return version ?? '';
};
}

/**
* Returns the version and URL for the latest release of all implementations.
*/
module.exports = async () => {
export default async function (): Promise<Record<string, Release>> {
const repos = ['sass/libsass', 'sass/dart-sass', 'sass/migrator'];
const cache = await getCacheFile();

Expand All @@ -120,4 +129,4 @@ module.exports = async () => {
}

return data;
};
}
Binary file added source/assets/img/blog/042-blue-yellow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/042-p3-hsl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/042-p3-oklch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/042-p3-srgb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/042-srgb-hsl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/042-srgb-hwb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/042-srgb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading