Skip to content

Commit

Permalink
Add: Frame Colors
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Jun 20, 2024
1 parent 35e975e commit 3498089
Show file tree
Hide file tree
Showing 54 changed files with 218 additions and 70 deletions.
2 changes: 1 addition & 1 deletion internal
19 changes: 17 additions & 2 deletions packages/core/src/config/syntaxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@ const syntaxes = {
ambiguousKeys: ['text-stroke'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.Native,
variables: ['text'],
declare(value) {
return {
'-webkit-text-stroke-color': value
Expand Down Expand Up @@ -920,26 +919,31 @@ const syntaxes = {
ambiguousKeys: ['bt', 'border-top'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.Native,
variables: ['frame'],
} as SyntaxDefinition,
'border-bottom-color': {
ambiguousKeys: ['bb', 'border-bottom'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.Native,
variables: ['frame'],
} as SyntaxDefinition,
'border-left-color': {
ambiguousKeys: ['bl', 'border-left'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.Native,
variables: ['frame'],
} as SyntaxDefinition,
'border-right-color': {
ambiguousKeys: ['br', 'border-right'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.Native,
variables: ['frame'],
} as SyntaxDefinition,
'border-x-color': {
ambiguousKeys: ['bx', 'border-x'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.Shorthand,
variables: ['frame'],
declare(value) {
return {
'border-left-color': value,
Expand All @@ -951,6 +955,7 @@ const syntaxes = {
ambiguousKeys: ['by', 'border-y'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.Shorthand,
variables: ['frame'],
declare(value) {
return {
'border-top-color': value,
Expand All @@ -962,6 +967,7 @@ const syntaxes = {
ambiguousKeys: ['b', 'border'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.NativeShorthand,
variables: ['frame'],
} as SyntaxDefinition,
// border radius
'border-top-left-radius': {
Expand Down Expand Up @@ -1172,30 +1178,35 @@ const syntaxes = {
layer: Layer.NativeShorthand,
unit: 'rem',
transformValueComponents: autofillSolidStyle,
variables: ['frame'],
} as SyntaxDefinition,
'border-bottom': {
key: 'bb',
layer: Layer.NativeShorthand,
unit: 'rem',
transformValueComponents: autofillSolidStyle,
variables: ['frame'],
} as SyntaxDefinition,
'border-left': {
key: 'bl',
layer: Layer.NativeShorthand,
unit: 'rem',
transformValueComponents: autofillSolidStyle,
variables: ['frame'],
} as SyntaxDefinition,
'border-right': {
key: 'br',
layer: Layer.NativeShorthand,
unit: 'rem',
transformValueComponents: autofillSolidStyle,
variables: ['frame'],
} as SyntaxDefinition,
'border-x': {
key: 'bx',
unit: 'rem',
layer: Layer.Shorthand,
transformValueComponents: autofillSolidStyle,
variables: ['frame'],
declare(value) {
return {
'border-left': value,
Expand All @@ -1208,6 +1219,7 @@ const syntaxes = {
unit: 'rem',
layer: Layer.Shorthand,
transformValueComponents: autofillSolidStyle,
variables: ['frame'],
declare(value) {
return {
'border-top': value,
Expand All @@ -1220,6 +1232,7 @@ const syntaxes = {
unit: 'rem',
layer: Layer.NativeShorthand,
transformValueComponents: autofillSolidStyle,
variables: ['frame'],
} as SyntaxDefinition,
'background-attachment': {
ambiguousKeys: ['bg'],
Expand Down Expand Up @@ -1539,6 +1552,7 @@ const syntaxes = {
ambiguousKeys: ['outline'],
ambiguousValues: [COLOR_VALUE_REGEX],
layer: Layer.Native,
variables: ['frame'],
} as SyntaxDefinition,
'outline-offset': {
unit: 'rem',
Expand All @@ -1563,7 +1577,8 @@ const syntaxes = {
'outline-width',
'outline-style',
'outline-offset',
'outline-color'
'outline-color',
'frame'
],
transformValueComponents: autofillSolidStyle
} as SyntaxDefinition,
Expand Down
24 changes: 18 additions & 6 deletions packages/core/src/config/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,24 @@ const _variables = {
view: 'view-box'
},
current: 'currentColor',
frame: {
neutral: {
'@light': '$(slate-60)',
'@dark': '$(gray-30)'
},
light: {
'@light': '$(slate-60)/.2',
'@dark': '$(gray-30)/.2'
},
lighter: {
'@light': '$(slate-60)/.16',
'@dark': '$(gray-30)/.16'
},
lightest: {
'@light': '$(slate-60)/.12',
'@dark': '$(gray-30)/.12'
}
},
// from figma
white: '#ffffff',
black: '#000000',
Expand All @@ -139,12 +157,6 @@ const _variables = {
'@light': '$(black)',
'@dark': '$(white)',
},
frame: {
neutral: {
'@light': '$(slate-60)',
'@dark': '$(gray-30)',
},
},
gray: {
'@light': '$(gray-30)',
'@dark': '$(gray-40)',
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/blog/v2/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Vestibulum fringilla varius semper. Sed in placerat est, in iaculis urna. Sed at
## New Configuration API

### `.animations`
You can now customize CSS [animations](/reference/configuration#animations) in `master.css.js`:
You can now customize CSS [animations](/guide/configuration#animations) in `master.css.js`:
```js name=master.css.js
export default {
animations: {
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/code-linting/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ In the past, you added utility classes to your templates unsafely, lacking the c
This is helpful if you make a typo or are unfamiliar with Master CSS syntax!

### Disallow unknown classes
You can also restrict teams to using [configuration](/reference/configuration) to create [styles](/guide/styles) instead of defining classes through traditional `html <style>` or CSS files.
You can also restrict teams to using [configuration](/guide/configuration) to create [styles](/guide/styles) instead of defining classes through traditional `html <style>` or CSS files.

(i) Based on syntax error checking, you can [disallow unknown classes](/reference/eslint#class-validation).
<Image className="aspect:2/1 r:2x max-w:screen-xs w:full" src={require('~/site/public/disallow-unknown-class.webp').default} alt="Disallow unknown classes" unoptimized />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The easiest way to use Master CSS from scratch is to initialize the [runtime eng
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.js](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.js](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/angular/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import ProgressiveRenderingIntro from '../../rendering-modes/components/Progress
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import RuntimeRenderingIntro from '../../../rendering-modes/components/RuntimeRe
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/astro/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import RuntimeRenderingIntro from '../../rendering-modes/components/RuntimeRende
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/blazor/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import RuntimeRenderingIntro from '../../rendering-modes/components/RuntimeRende
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/laravel/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import RuntimeRenderingIntro from '../../rendering-modes/components/RuntimeRende
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.js](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.js](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.js](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.js](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/nextjs/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import ProgressiveRenderingIntro from '../../rendering-modes/components/Progress
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import RuntimeRenderingIntro from '../../../rendering-modes/components/RuntimeRe
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/nuxtjs/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import ProgressiveRenderingIntro from '../../rendering-modes/components/Progress
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import RuntimeRenderingIntro from '../../../rendering-modes/components/RuntimeRe
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/react/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ A full-stack framework, such as [Next.js](/guide/installation/nextjs), [Remix](/
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/svelte/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import ProgressiveRenderingIntro from '../../rendering-modes/components/Progress
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import RuntimeRenderingIntro from '../../../rendering-modes/components/RuntimeRe
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
2 changes: 1 addition & 1 deletion site/app/[locale]/guide/installation/vite/content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import RuntimeRenderingIntro from '../../rendering-modes/components/RuntimeRende
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import StaticExtractionIntro from '../../../rendering-modes/components/StaticExt
<Step $row>
<StepL>
### <StepNum />Initialize configuration file
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/reference/configuration).
Run `npm create @master/css@rc` to create a configuration file [master.css.ts](/guide/configuration).
</StepL>
<StepR>
```bash name=Terminal
Expand Down
Loading

0 comments on commit 3498089

Please sign in to comment.