Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f555ced
feat: Extract tokens to json files
aaronccasanova Dec 8, 2021
bc6a2a9
feat: Validate tokens with json schema and the ajv package
aaronccasanova Dec 8, 2021
cb2e2cc
fix: Update formatting
aaronccasanova Dec 8, 2021
32b3ad6
fix: Simplify validation script
aaronccasanova Dec 8, 2021
d0c9f8c
feat: Update CustomProperties component to use JSON tokens
aaronccasanova Dec 9, 2021
004d693
fix: Remove unneeded type changes
aaronccasanova Dec 9, 2021
32b091b
fix: Revert type order change
aaronccasanova Dec 9, 2021
9856314
fix: Convert px to rems in tokens.ts
aaronccasanova Dec 9, 2021
ba246d4
feat: Add @rollup/plugin-json
aaronccasanova Dec 9, 2021
662fa99
fix: Revert vscode settings change
aaronccasanova Dec 9, 2021
18e7b02
Merge branch 'v8.0.0-major' of https://github.com/Shopify/polaris-rea…
aaronccasanova Dec 9, 2021
8db478a
Merge branch 'feat/json-tokens' of https://github.com/Shopify/polaris…
aaronccasanova Dec 10, 2021
fb111b0
fix: Update rem utility to only transform valid px units
aaronccasanova Dec 10, 2021
1aef847
fix: Move token groups to 'src' directory to resolve build errors
aaronccasanova Dec 10, 2021
0d50a93
Merge branch 'v9.0.0-major' of https://github.com/Shopify/polaris-rea…
aaronccasanova Dec 10, 2021
495e7e9
Remove /tokens in favor of /src/tokens
aaronccasanova Dec 10, 2021
79c6738
feat: Update the custom stylelint plugin to use JSON tokens
aaronccasanova Dec 10, 2021
4965bec
fix: Remove temporary token-list file and loom config
aaronccasanova Dec 10, 2021
ef10506
fix: Convert legacy token rems to pxs
aaronccasanova Dec 10, 2021
d9bbc82
fix: Convert legacy token rems to pxs
aaronccasanova Dec 10, 2021
19bf686
Merge branch 'feat/json-token-custom-properties' of https://github.co…
aaronccasanova Dec 10, 2021
2ac6a5e
fix: Convert Frame offset from rems to pxs
aaronccasanova Dec 11, 2021
2826bb1
Merge branch 'v9.0.0-major' of https://github.com/Shopify/polaris-rea…
aaronccasanova Dec 11, 2021
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
26 changes: 24 additions & 2 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
const fs = require('fs');
const path = require('path');

const {tokenList} = require('./build/cjs/token-list');
const tokenGroupsDir = path.join(__dirname, './src/tokens/token-groups');

/**
* Allowed Polaris token custom properties.
*
* Result: ['--p-background', '--p-text', etc...]
*/
const polarisTokenCustomProperties = Array.from(
new Set(
fs
.readdirSync(tokenGroupsDir)
.map((file) => {
const tokenGroup = require(path.join(tokenGroupsDir, file));

return Object.keys(tokenGroup).map((token) => `--p-${token}`);
})
.flat(),
),
);

/**
* Allowed custom property names in Polaris component styles.
Expand All @@ -19,7 +38,10 @@ module.exports = {
polarisComponentCustomProperties,
],
allowedValues: {
'/.+/': [polarisComponentCustomProperties, ...tokenList],
'/.+/': [
polarisComponentCustomProperties,
...polarisTokenCustomProperties,
],
},
},
},
Expand Down
1 change: 0 additions & 1 deletion loom.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import type {} from '@shopify/loom-plugin-jest';
// eslint-disable-next-line import/no-default-export
export default createPackage((pkg) => {
pkg.entry({root: './src/index.ts'});
pkg.entry({name: 'token-list', root: './src/token-list.ts'});
pkg.use(
buildLibrary({
rootEntrypoints: false,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Frame/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ function FrameExample() {
>
<Frame
logo={logo}
offset="6rem"
offset="60px"
globalRibbon={
<div style={{background: '#C0FFEE', padding: '30px'}}>
Global ribbon
Expand Down
35 changes: 0 additions & 35 deletions src/token-list.ts

This file was deleted.