1
1
mirror of https://github.com/primer/css.git synced 2024-12-23 06:01:54 +03:00

Cleanup old Primitive imports (#2606)

* cleanup

* Create three-apples-beg.md

* add color imports to sb

* sb upgrades
This commit is contained in:
Katie Langerman 2024-04-09 11:55:11 -07:00 committed by GitHub
parent a723b65457
commit a03827b0a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 74 additions and 145 deletions

View File

@ -0,0 +1,5 @@
---
"@primer/css": patch
---
Cleanup old Primitive imports

View File

@ -1,9 +1,20 @@
@import '@primer/primitives/tokens-next-private/css/base/size/size.css';
@import '@primer/primitives/tokens-next-private/css/base/typography/typography.css';
@import '@primer/primitives/tokens-next-private/css/functional/size/border.css';
@import '@primer/primitives/tokens-next-private/css/functional/size/breakpoints.css';
@import '@primer/primitives/tokens-next-private/css/functional/size/size-coarse.css';
@import '@primer/primitives/tokens-next-private/css/functional/size/size-fine.css';
@import '@primer/primitives/tokens-next-private/css/functional/size/size.css';
@import '@primer/primitives/tokens-next-private/css/functional/size/viewport.css';
@import '@primer/primitives/tokens-next-private/css/functional/typography/typography.css';
@import '@primer/primitives/dist/css/base/size/size.css';
@import '@primer/primitives/dist/css/base/typography/typography.css';
@import '@primer/primitives/dist/css/functional/size/border.css';
@import '@primer/primitives/dist/css/functional/size/breakpoints.css';
@import '@primer/primitives/dist/css/functional/size/size-coarse.css';
@import '@primer/primitives/dist/css/functional/size/size-fine.css';
@import '@primer/primitives/dist/css/functional/size/size.css';
@import '@primer/primitives/dist/css/functional/size/viewport.css';
@import '@primer/primitives/dist/css/functional/typography/typography.css';
/* color */
@import '@primer/primitives/dist/css/functional/themes/light.css';
@import '@primer/primitives/dist/css/functional/themes/light-tritanopia.css';
@import '@primer/primitives/dist/css/functional/themes/light-high-contrast.css';
@import '@primer/primitives/dist/css/functional/themes/light-colorblind.css';
@import '@primer/primitives/dist/css/functional/themes/dark.css';
@import '@primer/primitives/dist/css/functional/themes/dark-colorblind.css';
@import '@primer/primitives/dist/css/functional/themes/dark-dimmed.css';
@import '@primer/primitives/dist/css/functional/themes/dark-high-contrast.css';
@import '@primer/primitives/dist/css/functional/themes/dark-tritanopia.css';

86
docs/package-lock.json generated
View File

@ -20,6 +20,8 @@
"babel-loader": "^8.2.5",
"clsx": "^1.2.1",
"eslint-plugin-storybook": "^0.6.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook": "^7.0.26",
"storybook-addon-pseudo-states": "^2.1.0"
},
@ -2493,9 +2495,9 @@
}
},
"node_modules/@eslint/eslintrc": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz",
"integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==",
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
"integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
"peer": true,
"dependencies": {
"ajv": "^6.12.4",
@ -2522,9 +2524,9 @@
"peer": true
},
"node_modules/@eslint/eslintrc/node_modules/globals": {
"version": "13.23.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz",
"integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==",
"version": "13.24.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"peer": true,
"dependencies": {
"type-fest": "^0.20.2"
@ -2561,9 +2563,9 @@
}
},
"node_modules/@eslint/js": {
"version": "8.52.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz",
"integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==",
"version": "8.57.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
"integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
"peer": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -2599,13 +2601,13 @@
}
},
"node_modules/@humanwhocodes/config-array": {
"version": "0.11.13",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz",
"integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==",
"version": "0.11.14",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
"integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
"peer": true,
"dependencies": {
"@humanwhocodes/object-schema": "^2.0.1",
"debug": "^4.1.1",
"@humanwhocodes/object-schema": "^2.0.2",
"debug": "^4.3.1",
"minimatch": "^3.0.5"
},
"engines": {
@ -2626,9 +2628,9 @@
}
},
"node_modules/@humanwhocodes/object-schema": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz",
"integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
"peer": true
},
"node_modules/@istanbuljs/load-nyc-config": {
@ -8604,16 +8606,16 @@
}
},
"node_modules/eslint": {
"version": "8.52.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz",
"integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==",
"version": "8.57.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.2",
"@eslint/js": "8.52.0",
"@humanwhocodes/config-array": "^0.11.13",
"@eslint/eslintrc": "^2.1.4",
"@eslint/js": "8.57.0",
"@humanwhocodes/config-array": "^0.11.14",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
"@ungap/structured-clone": "^1.2.0",
@ -8776,9 +8778,9 @@
}
},
"node_modules/eslint/node_modules/globals": {
"version": "13.23.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz",
"integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==",
"version": "13.24.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"peer": true,
"dependencies": {
"type-fest": "^0.20.2"
@ -8898,9 +8900,9 @@
}
},
"node_modules/espree/node_modules/acorn": {
"version": "8.11.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
"integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
"version": "8.11.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
"peer": true,
"bin": {
"acorn": "bin/acorn"
@ -11892,13 +11894,12 @@
"peer": true
},
"node_modules/needle": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/needle/-/needle-3.2.0.tgz",
"integrity": "sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==",
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz",
"integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==",
"optional": true,
"peer": true,
"dependencies": {
"debug": "^3.2.6",
"iconv-lite": "^0.6.3",
"sax": "^1.2.4"
},
@ -11909,16 +11910,6 @@
"node": ">= 4.4.x"
}
},
"node_modules/needle/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"optional": true,
"peer": true,
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/needle/node_modules/iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
@ -13026,7 +13017,6 @@
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
"integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
"peer": true,
"dependencies": {
"loose-envify": "^1.1.0"
},
@ -13083,7 +13073,6 @@
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
"integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
"peer": true,
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.0"
@ -13632,7 +13621,6 @@
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",
"integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
"peer": true,
"dependencies": {
"loose-envify": "^1.1.0"
}
@ -14573,9 +14561,9 @@
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="
},
"node_modules/typescript": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"version": "5.4.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz",
"integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==",
"peer": true,
"bin": {
"tsc": "bin/tsc",

View File

@ -24,6 +24,8 @@
"babel-loader": "^8.2.5",
"clsx": "^1.2.1",
"eslint-plugin-storybook": "^0.6.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook": "^7.0.26",
"storybook-addon-pseudo-states": "^2.1.0"
}

49
package-lock.json generated
View File

@ -33,7 +33,6 @@
"js-yaml": "^4.1.0",
"postcss": "^8.4.35",
"postcss-calc": "^9.0.1",
"postcss-custom-properties-fallback": "^1.0.2",
"postcss-import": "^16.0.1",
"postcss-load-config": "^5.0.3",
"postcss-scss": "^4.0.5",
@ -6428,18 +6427,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-url-superb": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz",
"integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==",
"dev": true,
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-vendor-prefixed": {
"version": "4.0.0",
"dev": true,
@ -8116,19 +8103,6 @@
"postcss": "^8.4"
}
},
"node_modules/postcss-custom-properties-fallback": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/postcss-custom-properties-fallback/-/postcss-custom-properties-fallback-1.0.2.tgz",
"integrity": "sha512-UrPr99bo03c1iX4iqjBBYo3W+EsXfxrozp2LNvRN34Y95n/7R2RupcMhGlc+C/RQxknDXiP+bptyhmb8nFYzeQ==",
"dev": true,
"dependencies": {
"postcss-value-parser": "^4.2.0",
"postcss-values-parser": "^6.0.2"
},
"peerDependencies": {
"postcss": "^8.0.0"
}
},
"node_modules/postcss-import": {
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-16.1.0.tgz",
@ -8275,23 +8249,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/postcss-values-parser": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz",
"integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==",
"dev": true,
"dependencies": {
"color-name": "^1.1.4",
"is-url-superb": "^4.0.0",
"quote-unquote": "^1.0.0"
},
"engines": {
"node": ">=10"
},
"peerDependencies": {
"postcss": "^8.2.9"
}
},
"node_modules/preferred-pm": {
"version": "3.0.3",
"dev": true,
@ -8499,12 +8456,6 @@
"node": ">=8"
}
},
"node_modules/quote-unquote": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz",
"integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==",
"dev": true
},
"node_modules/react-is": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",

View File

@ -65,7 +65,6 @@
"js-yaml": "^4.1.0",
"postcss": "^8.4.35",
"postcss-calc": "^9.0.1",
"postcss-custom-properties-fallback": "^1.0.2",
"postcss-import": "^16.0.1",
"postcss-load-config": "^5.0.3",
"postcss-scss": "^4.0.5",

View File

@ -3,8 +3,6 @@ const sass = require('@csstools/postcss-sass')
const scss = require('postcss-scss')
const scssImport = require('postcss-import')
const { join } = require('path')
const path = require('path')
const fs = require('fs')
module.exports = {
map: {
@ -19,31 +17,6 @@ module.exports = {
includePaths: [join(__dirname, 'node_modules')],
outputStyle: process.env.CSS_MINIFY === '0' ? 'expanded' : 'compressed'
}),
autoprefixer,
require('postcss-custom-properties-fallback')({
importFrom: [
() => {
const primitiveFallbacks = [
'color-fallbacks.json',
'base/size/size.json',
'base/typography/typography.json',
'functional/size/border.json',
'functional/size/breakpoints.json',
'functional/size/size-coarse.json',
'functional/size/size-fine.json',
'functional/size/size.json',
'functional/size/viewport.json',
'functional/typography/typography.json',
]
let customProperties = {}
for (const filePath of primitiveFallbacks) {
const fileData = fs.readFileSync(path.join(__dirname, './node_modules/@primer/primitives/tokens-next-private/fallbacks/', filePath), 'utf8')
customProperties = {...customProperties, ...JSON.parse(fileData)}
}
return { customProperties: customProperties };
}
]
}),
autoprefixer
]
}

View File

@ -1,10 +1,10 @@
@import '@primer/primitives/tokens-next-private/css/base/size/size';
@import '@primer/primitives/tokens-next-private/css/base/typography/typography';
@import '@primer/primitives/tokens-next-private/css/functional/size/border';
@import '@primer/primitives/tokens-next-private/css/functional/size/breakpoints';
@import '@primer/primitives/tokens-next-private/css/functional/size/size-coarse';
@import '@primer/primitives/tokens-next-private/css/functional/size/size-fine';
@import '@primer/primitives/tokens-next-private/css/functional/size/size';
@import '@primer/primitives/tokens-next-private/css/functional/size/viewport';
@import '@primer/primitives/tokens-next-private/css/functional/typography/typography';
@import '@primer/primitives/dist/css/base/size/size';
@import '@primer/primitives/dist/css/base/typography/typography';
@import '@primer/primitives/dist/css/functional/size/border';
@import '@primer/primitives/dist/css/functional/size/breakpoints';
@import '@primer/primitives/dist/css/functional/size/size-coarse';
@import '@primer/primitives/dist/css/functional/size/size-fine';
@import '@primer/primitives/dist/css/functional/size/size';
@import '@primer/primitives/dist/css/functional/size/viewport';
@import '@primer/primitives/dist/css/functional/typography/typography';
@import './temp-typography-tokens.scss';