@sumup/design-tokens
Advanced tools
Comparing version 7.2.0-next.1 to 7.2.0-next.2
@@ -53,2 +53,22 @@ #!/usr/bin/env node | ||
{ | ||
name: 'light-scoped', | ||
groups: [ | ||
{ | ||
tokens: light_js_1.light, | ||
selectors: ['[data-color-scheme="light"]'], | ||
colorScheme: 'light', | ||
}, | ||
], | ||
}, | ||
{ | ||
name: 'dark-scoped', | ||
groups: [ | ||
{ | ||
tokens: dark_js_1.dark, | ||
selectors: ['[data-color-scheme="dark"]'], | ||
colorScheme: 'dark', | ||
}, | ||
], | ||
}, | ||
{ | ||
name: 'dynamic', | ||
@@ -114,6 +134,6 @@ groups: [ | ||
}); | ||
// Validate that all tokens have a default value defined at the root | ||
// Validate that the tokens at the root are complete | ||
const rootGroup = theme.groups.find((group) => group.selectors.length === 1 && group.selectors[0] === ':root'); | ||
if (!rootGroup) { | ||
throw new Error(`The "${theme.name}" theme does not define any global tokens. Add them to the ":root" selector.`); | ||
return; | ||
} | ||
@@ -120,0 +140,0 @@ if (rootGroup.tokens.length !== schema_js_1.schema.length) { |
@@ -47,2 +47,22 @@ #!/usr/bin/env node | ||
{ | ||
name: 'light-scoped', | ||
groups: [ | ||
{ | ||
tokens: light, | ||
selectors: ['[data-color-scheme="light"]'], | ||
colorScheme: 'light', | ||
}, | ||
], | ||
}, | ||
{ | ||
name: 'dark-scoped', | ||
groups: [ | ||
{ | ||
tokens: dark, | ||
selectors: ['[data-color-scheme="dark"]'], | ||
colorScheme: 'dark', | ||
}, | ||
], | ||
}, | ||
{ | ||
name: 'dynamic', | ||
@@ -108,6 +128,6 @@ groups: [ | ||
}); | ||
// Validate that all tokens have a default value defined at the root | ||
// Validate that the tokens at the root are complete | ||
const rootGroup = theme.groups.find((group) => group.selectors.length === 1 && group.selectors[0] === ':root'); | ||
if (!rootGroup) { | ||
throw new Error(`The "${theme.name}" theme does not define any global tokens. Add them to the ":root" selector.`); | ||
return; | ||
} | ||
@@ -114,0 +134,0 @@ if (rootGroup.tokens.length !== schema.length) { |
{ | ||
"name": "@sumup/design-tokens", | ||
"version": "7.2.0-next.1", | ||
"version": "7.2.0-next.2", | ||
"description": "Visual primitives such as typography, color, and spacing that are shared across platforms.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
325330
44
11084