@codecademy/gamut 68.6.1-alpha.edab62.0 → 68.6.1-alpha.f6b2ce.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/agent-tools/.cursor-plugin/plugin.json +1 -1
  2. package/agent-tools/DESIGN.Codecademy.md +466 -413
  3. package/agent-tools/DESIGN.LXStudio.md +350 -282
  4. package/agent-tools/DESIGN.Percipio.md +357 -279
  5. package/agent-tools/commands/gamut-review.md +176 -87
  6. package/agent-tools/guidelines/components/animations.md +74 -0
  7. package/agent-tools/guidelines/components/buttons.md +74 -23
  8. package/agent-tools/guidelines/components/card.md +19 -0
  9. package/agent-tools/guidelines/components/coachmark.md +21 -0
  10. package/agent-tools/guidelines/components/data-table.md +79 -0
  11. package/agent-tools/guidelines/components/forms.md +106 -0
  12. package/agent-tools/guidelines/components/loading-states.md +17 -0
  13. package/agent-tools/guidelines/components/menu.md +58 -0
  14. package/agent-tools/guidelines/components/overview.md +97 -17
  15. package/agent-tools/guidelines/components/radial-progress.md +13 -0
  16. package/agent-tools/guidelines/components/select.md +23 -0
  17. package/agent-tools/guidelines/components/tooltips.md +22 -0
  18. package/agent-tools/guidelines/components/video.md +29 -0
  19. package/agent-tools/guidelines/foundations/color.md +140 -58
  20. package/agent-tools/guidelines/foundations/modes.md +41 -17
  21. package/agent-tools/guidelines/foundations/spacing.md +78 -37
  22. package/agent-tools/guidelines/foundations/typography.md +69 -37
  23. package/agent-tools/guidelines/overview-icons.md +19 -0
  24. package/agent-tools/guidelines/overview-illustrations.md +7 -0
  25. package/agent-tools/guidelines/overview-patterns.md +7 -0
  26. package/agent-tools/guidelines/overview.md +71 -22
  27. package/agent-tools/guidelines/setup.md +59 -18
  28. package/agent-tools/rules/accessibility.mdc +22 -13
  29. package/agent-tools/skills/gamut-accessibility/SKILL.md +97 -112
  30. package/agent-tools/skills/gamut-color-mode/SKILL.md +91 -41
  31. package/agent-tools/skills/gamut-components/SKILL.md +46 -0
  32. package/agent-tools/skills/gamut-forms/SKILL.md +101 -0
  33. package/agent-tools/skills/gamut-style-utilities/SKILL.md +111 -0
  34. package/agent-tools/skills/gamut-system-props/SKILL.md +81 -29
  35. package/agent-tools/skills/gamut-testing/SKILL.md +106 -62
  36. package/agent-tools/skills/gamut-theming/SKILL.md +36 -86
  37. package/agent-tools/skills/gamut-typography/SKILL.md +36 -80
  38. package/bin/commands/plugin/install.mjs +96 -56
  39. package/bin/commands/plugin/list.mjs +11 -43
  40. package/bin/commands/plugin/remove.mjs +30 -38
  41. package/bin/commands/plugin/update.mjs +15 -5
  42. package/bin/gamut.mjs +17 -13
  43. package/bin/lib/design.mjs +71 -0
  44. package/bin/lib/io.mjs +14 -0
  45. package/package.json +6 -6
  46. package/bin/lib/figma.mjs +0 -49
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: gamut-forms
3
+ description: Implementing or auditing Gamut forms — GridForm, ConnectedForm, FormGroup, labels, validation. When invoked, read guidelines/components/forms.md first. Pair with gamut-accessibility for non-form widgets.
4
+ ---
5
+
6
+ # Gamut forms
7
+
8
+ ## Read first
9
+
10
+ When this skill applies, read [`guidelines/components/forms.md`](../../guidelines/components/forms.md) before writing code.
11
+
12
+ Canonical wiring for `FormGroup`, `ConnectedForm`, `ConnectedFormGroup`, `GridForm`, and field renderers. Source: `packages/gamut/src/Form/`, `ConnectedForm/`, `GridForm/`.
13
+
14
+ Universal label and primitive guidance: [`accessibility.mdc`](../../rules/accessibility.mdc) · overlay and composite patterns: [`gamut-accessibility`](../gamut-accessibility/SKILL.md).
15
+
16
+ ---
17
+
18
+ ## Mandatory: use organisms for functional forms
19
+
20
+ Functional forms (submit/save, validation, dirty state) must use `GridForm` or `ConnectedForm`. Do not compose from bare `Input`, `Select`, `Checkbox`, etc.
21
+
22
+ | Organism | When |
23
+ | --------------- | -------------------------------------------------------- |
24
+ | `GridForm` | Declarative `fields` + `submit` — settings, CRUD dialogs |
25
+ | `ConnectedForm` | Custom layout with managed `react-hook-form` state |
26
+
27
+ Rules: Always set `defaultValues`. Use `validation="onChange"` when submit should stay disabled until valid. `hideLabel: true` on checkbox/radio fields with no `label`, and on toggle (`custom`) fields where `Toggle` renders its own label.
28
+
29
+ ---
30
+
31
+ ## Prefer connected layouts
32
+
33
+ For typical product forms, prefer `GridForm` (declarative `fields`, `LayoutGrid`, submit/cancel) or `ConnectedForm` with `ConnectedFormGroup` / `useConnectedForm`. Use raw `FormGroup` + atoms only when the layout is simple and you fully own `id`, `htmlFor`, invalid state, and any `aria-describedby` (see below).
34
+
35
+ ---
36
+
37
+ ## Labels and controls
38
+
39
+ `htmlFor` / `id` pairing — universal rule in [`accessibility.mdc`](../../rules/accessibility.mdc) (Form label association). Form-specific notes:
40
+
41
+ - `FormGroupLabel` → control `id` (or stable `name` when that is your field’s id convention).
42
+ - Checkbox, Radio, Select: same pairing; checkbox/radio use the visually hidden input pattern from `@codecademy/gamut-styles` where applicable.
43
+
44
+ ---
45
+
46
+ ## `FormGroup` (baseline)
47
+
48
+ [`FormGroup.tsx`](https://github.com/Codecademy/gamut/blob/main/packages/gamut/src/Form/elements/FormGroup.tsx)
49
+
50
+ - `description` → `FormGroupDescription` with `aria-live="assertive"`.
51
+ - `error` (string) → `FormError` with `aria-live="polite"` and `role="alert"`.
52
+
53
+ Raw `FormGroup` does not set `aria-describedby` or `aria-invalid` on `children`. If you compose fields outside `ConnectedFormGroup` / `GridForm`, wire those yourself or accept that only the live regions above communicate errors/descriptions.
54
+
55
+ ---
56
+
57
+ ## `ConnectedFormGroup`
58
+
59
+ [`ConnectedFormGroup.tsx`](https://github.com/Codecademy/gamut/blob/main/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx)
60
+
61
+ - Passes `aria-describedby` (error region id when shown) and `aria-invalid` on the rendered field component.
62
+ - `FormError`: `aria-live="assertive"` and `role="alert"` only when `isFirstError`; otherwise `aria-live="off"` and `role="status"` so subsequent errors do not interrupt repeatedly.
63
+
64
+ ---
65
+
66
+ ## `GridForm`
67
+
68
+ [`GridFormInputGroup/index.tsx`](https://github.com/Codecademy/gamut/blob/main/packages/gamut/src/GridForm/GridFormInputGroup/index.tsx) · [`GridFormTextInput`](https://github.com/Codecademy/gamut/blob/main/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextInput/index.tsx)
69
+
70
+ - Composes `ConnectedForm`, `LayoutGrid`, `GridFormButtons`, and field metadata. `FormError` uses the same first-error assertive pattern as `ConnectedFormGroup` (`aria-live` assertive vs off, `role` alert vs status).
71
+ - Built-in text inputs set `aria-invalid` and register with react-hook-form via `register`. Custom / `custom` / `custom-group` renderers must still expose correct `id`, `label`, and error surfacing consistent with this pattern.
72
+
73
+ ---
74
+
75
+ ## Live regions — do not double up
76
+
77
+ `FormGroup`, `ConnectedFormGroup`, and `GridForm` already render `FormError` (and base `FormGroup` renders `FormGroupDescription`) with live-region attributes. Do not add a second `aria-live` wrapper for the same message stream.
78
+
79
+ ---
80
+
81
+ ## Storybook
82
+
83
+ - [Organisms / GridForm / About](https://gamut.codecademy.com/?path=/docs-organisms-gridform-about--docs) · [Usage](https://gamut.codecademy.com/?path=/docs-organisms-gridform-usage--docs) · [Validation](https://gamut.codecademy.com/?path=/docs-organisms-gridform-validation--docs) · [Fields](https://gamut.codecademy.com/?path=/docs-organisms-gridform-fields--docs)
84
+ - [Organisms / ConnectedForm / ConnectedForm](https://gamut.codecademy.com/?path=/docs-organisms-connectedform-connectedform--docs) · [ConnectedFormGroup](https://gamut.codecademy.com/?path=/docs-organisms-connectedform-connectedformgroup--docs)
85
+
86
+ ---
87
+
88
+ ## Example — baseline `FormGroup`
89
+
90
+ ```tsx
91
+ <FormGroup
92
+ htmlFor="email-input"
93
+ description="Used for login"
94
+ error={errors.email}
95
+ >
96
+ <FormGroupLabel htmlFor="email-input">Email</FormGroupLabel>
97
+ <Input id="email-input" type="email" />
98
+ </FormGroup>
99
+ ```
100
+
101
+ When using `ConnectedFormGroup` or `GridForm`, prefer their docs and defaults over hand-rolling the above for every field.
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: gamut-style-utilities
3
+ description: css(), variant(), states(), StyleProps, useTheme from @codecademy/gamut-styles. When invoked, read guidelines/foundations/color.md for semantic tokens.
4
+ ---
5
+
6
+ # Gamut style utilities
7
+
8
+ ## Read first
9
+
10
+ When this skill applies, read [`guidelines/foundations/color.md`](../../guidelines/foundations/color.md) before choosing color tokens in `css` / `variant` / `states`.
11
+
12
+ Source: `@codecademy/gamut-styles` — [`variance/props.ts`](https://github.com/Codecademy/gamut/blob/main/packages/gamut-styles/src/variance/props.ts) (`css`, `variant`, `states` built on `PROPERTIES.all`).
13
+
14
+ See also: [`gamut-theming`](../gamut-theming/SKILL.md) (which theme, `GamutProvider`, new themes). [`gamut-system-props`](../gamut-system-props/SKILL.md) (`system.*`, responsive props, `Box`). [`gamut-color-mode`](../gamut-color-mode/SKILL.md) (semantic color, `<ColorMode>`, `<Background>`). [Best practices](../../../../styleguide/src/lib/Meta/Best%20practices.mdx) and [system compose](https://gamut.codecademy.com/?path=/docs-foundations-system-compose--page).
15
+
16
+ ## Overview
17
+
18
+ Use `css()`, `variant()`, and `states()` from `@codecademy/gamut-styles` for typed, token-scaled style objects (same scales as composed `system.*` props). Prefer semantic color keys so styles track ColorMode and theme.
19
+
20
+ For layout-heavy styled components, prefer composing `system.*` via `variance.compose()` (see `gamut-system-props`) instead of re-stating every longhand in `css()`.
21
+
22
+ ## `css()` — static style objects
23
+
24
+ ```tsx
25
+ import { css } from '@codecademy/gamut-styles';
26
+ import styled from '@emotion/styled';
27
+
28
+ const Box = styled.div(css({ bg: 'navy-400', p: 4 }));
29
+ const Text = styled.div(css({ color: 'primary', p: 4 }));
30
+ ```
31
+
32
+ ## `variant()` and `states()` — branching and toggles
33
+
34
+ - `variant()` — mutually exclusive modes: `base`, `defaultVariant`, and a `variants` map (semantic colors, spacing shorthands, nested selectors such as `'&:hover'`).
35
+
36
+ ```tsx
37
+ import { variant } from '@codecademy/gamut-styles';
38
+ import styled from '@emotion/styled';
39
+
40
+ const Anchor = styled.a(
41
+ variant({
42
+ base: { p: 4 },
43
+ defaultVariant: 'interface',
44
+ variants: {
45
+ interface: {
46
+ color: 'text',
47
+ '&:hover': { color: 'text-accent' },
48
+ },
49
+ inline: {
50
+ color: 'primary',
51
+ '&:hover': { color: 'secondary' },
52
+ },
53
+ },
54
+ })
55
+ );
56
+ ```
57
+
58
+ - `states()` — independent boolean-style props (`base` + named keys).
59
+
60
+ ```tsx
61
+ import { states } from '@codecademy/gamut-styles';
62
+ import styled from '@emotion/styled';
63
+
64
+ const UtilityBox = styled.div(
65
+ states({
66
+ base: { mx: 4, my: 8, p: 16 },
67
+ disabled: { bg: 'background-disabled', color: 'text-disabled' },
68
+ center: { alignItems: 'center', justifyContent: 'center' },
69
+ })
70
+ );
71
+ ```
72
+
73
+ ### `StyleProps` on React components
74
+
75
+ ```tsx
76
+ import { states } from '@codecademy/gamut-styles';
77
+ import { StyleProps } from '@codecademy/variance';
78
+ import styled from '@emotion/styled';
79
+
80
+ const panelShellStates = states({ base: { p: 4 }, dense: { p: 2 } });
81
+ const PanelShell = styled.div(panelShellStates);
82
+
83
+ export type PanelShellProps = StyleProps<typeof panelShellStates> & {
84
+ title: string;
85
+ };
86
+
87
+ export const Panel: React.FC<PanelShellProps> = ({ title, ...rest }) => (
88
+ <PanelShell {...rest}>{title}</PanelShell>
89
+ );
90
+ ```
91
+
92
+ Prefer `variant` / `states` over branching on raw `theme` fields inside styled template literals when the output is Emotion-managed CSS.
93
+
94
+ ## `useTheme()` — escape hatch
95
+
96
+ Prefer `css()`, `system.*`, `variant()`, and `states()` for styling. Use `useTheme()` from `@emotion/react` when a token value must be read in plain JS (charts, canvas, third-party props), not as the default way to color DOM nodes.
97
+
98
+ ```tsx
99
+ import { useTheme } from '@emotion/react';
100
+
101
+ const Sparkline = () => {
102
+ const theme = useTheme();
103
+ return <path strokeWidth={theme.spacing[4]} d="M0 0 L10 10" />;
104
+ };
105
+ ```
106
+
107
+ ## Key principles
108
+
109
+ - Prefer semantic color keys in `css` / `variant` / `states` so ColorMode and theme switches apply; see `gamut-color-mode`.
110
+ - Never hardcode hex in component styles — use tokens / semantic aliases.
111
+ - Prefer `variant` / `states` for modes and toggles instead of ad-hoc `theme` interpolation in template literals.
@@ -1,20 +1,45 @@
1
1
  ---
2
2
  name: gamut-system-props
3
- description: Use this skill when building or refactoring styled Gamut components that need layout, spacing, color, border, background, typography, positioning, grid, flex, shadow, or responsive values from @codecademy/gamut-styles including composing system prop groups with variance.
3
+ description: Layout, spacing, color, flex, grid system props from @codecademy/gamut-styles. When invoked, read guidelines/foundations/spacing.md first.
4
4
  ---
5
5
 
6
6
  # Gamut System Props
7
7
 
8
- Source: `@codecademy/gamut-styles` — [`variance/config.ts`](https://github.com/Codecademy/gamut/blob/main/packages/gamut-styles/src/variance/config.ts)
8
+ ## Read first
9
+
10
+ When this skill applies, read [`guidelines/foundations/spacing.md`](../../guidelines/foundations/spacing.md) before writing code.
11
+
12
+ Source: `@codecademy/gamut-styles` — [`variance/config.ts`](https://github.com/Codecademy/gamut/blob/main/packages/gamut-styles/src/variance/config.ts) (definitions) and [`variance/props.ts`](https://github.com/Codecademy/gamut/blob/main/packages/gamut-styles/src/variance/props.ts) (`variance.create` groups). `Box`, `FlexBox`, and `GridBox` compose the same groups in [`packages/gamut/src/Box/props.ts`](https://github.com/Codecademy/gamut/blob/main/packages/gamut/src/Box/props.ts).
13
+
14
+ See also: [`gamut-style-utilities`](../gamut-style-utilities/SKILL.md) (`css`, `variant`, `states`, `StyleProps`). [foundations/spacing.md](../../guidelines/foundations/spacing.md) (token scale). [Styleguide — Best practices](../../../../styleguide/src/lib/Meta/Best%20practices.mdx) and Storybook [Responsive properties](https://gamut.codecademy.com/storybook/?path=/docs-foundations-system-responsive-properties--page).
15
+
16
+ ## Styling rules
17
+
18
+ - Never use inline `style` attributes. Use system props on `Box` / `FlexBox` / `Text`, or `css` / `variant` / `states` on styled components.
19
+ - Use shorthand — `mb={16}`, not `marginBottom={16}`.
20
+
21
+ | Long form | Shorthand |
22
+ | -------------- | --------- |
23
+ | `margin` | `m` |
24
+ | `marginTop` | `mt` |
25
+ | `marginBottom` | `mb` |
26
+ | `marginX` | `mx` |
27
+ | `marginY` | `my` |
28
+ | `padding` | `p` |
29
+ | `paddingX` | `px` |
30
+ | `paddingY` | `py` |
31
+
32
+ Colors and borders: `bg`, `color` / `textColor`, `borderColor`, `borderRadius` — values must be Gamut tokens, never raw hex.
9
33
 
10
34
  ## Overview
11
35
 
12
36
  System props are strongly-typed, theme-connected CSS prop groups from `@codecademy/gamut-styles`. They give styled components a consistent, responsive API. All props are built on top of `@codecademy/variance`.
13
37
 
14
38
  Each prop group has:
15
- - **`properties`**: The CSS properties it controls
16
- - **`scale`**: Token scale it's restricted to (theme colors, spacing values, etc.)
17
- - **`transform`**: Optional transform applied before output (e.g. `width={0.5}` `width: 50%`)
39
+
40
+ - `properties`: The CSS properties it controls
41
+ - `scale`: Token scale it's restricted to (theme colors, spacing values, etc.)
42
+ - `transform`: Optional transform applied before output (e.g. `width={0.5}` → `width: 50%`)
18
43
 
19
44
  ## Basic usage
20
45
 
@@ -39,7 +64,7 @@ const FlexBox = styled.div(
39
64
 
40
65
  ### `system.layout`
41
66
 
42
- Controls dimensions, display, overflow, and container behavior.
67
+ Controls dimensions, display, overflow, and container behavior. This group also carries flex/grid item props used when laying out children: `flexGrow`, `flexShrink`, `flexBasis`, `order`, `gridColumn`, `gridRow`, `gridColumnStart`, `gridRowStart`, `gridColumnEnd`, `gridRowEnd`, `alignSelf`, `justifySelf`, `gridArea`.
43
68
 
44
69
  ```tsx
45
70
  const Box = styled.div(system.layout);
@@ -47,7 +72,7 @@ const Box = styled.div(system.layout);
47
72
  <Box display="flex" width="50%" height="300px" verticalAlign="middle" />;
48
73
  ```
49
74
 
50
- Key props: `display`, `width`, `height`, `minWidth`, `maxWidth`, `minHeight`, `maxHeight`, `overflow`, `overflowX`, `overflowY`, `verticalAlign`
75
+ Key props: `containerType`, `display`, `direction`, `dimensions`, `width`, `height`, `minWidth`, `maxWidth`, `minHeight`, `maxHeight`, `overflow`, `overflowX`, `overflowY`, `verticalAlign`, plus the item props above (see `config.ts` for the full map).
51
76
 
52
77
  ### `system.space`
53
78
 
@@ -59,7 +84,7 @@ const Box = styled.div(system.space);
59
84
  // Single value
60
85
  <Box p={8} m={16} />;
61
86
 
62
- // Responsive array syntax: [mobile, tablet, desktop]
87
+ // Responsive (array / object see Responsive values)
63
88
  <Box my={[16, 24, 32]} px={[8, 16]} />;
64
89
  ```
65
90
 
@@ -72,10 +97,10 @@ Foreground, background, and border colors restricted to the theme's color palett
72
97
  ```tsx
73
98
  const Box = styled.div(system.color);
74
99
 
75
- <Box bg="navy" textColor="gray-100" borderColor="blue" />;
100
+ <Box bg="navy" color="gray-900" textColor="gray-100" borderColor="blue" />;
76
101
  ```
77
102
 
78
- Key props: `bg` (background-color shorthand), `textColor`, `borderColor`
103
+ Key props: `color`, `textColor` (both set CSS `color`), `bg`, `borderColor`, plus directional `borderColor*` variants — see `config.ts` for the full set.
79
104
 
80
105
  ### `system.typography`
81
106
 
@@ -84,16 +109,22 @@ Text styling connected to theme typography scales.
84
109
  ```tsx
85
110
  const Text = styled.p(system.typography);
86
111
 
87
- <Text fontSize={16} fontFamily="accent" textTransform="uppercase" lineHeight={1.5} />;
112
+ <Text
113
+ fontSize={16}
114
+ fontFamily="accent"
115
+ fontStyle="italic"
116
+ textTransform="uppercase"
117
+ lineHeight="base"
118
+ />;
88
119
  ```
89
120
 
90
- Key props: `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, `textAlign`, `textTransform`, `textDecoration`, `letterSpacing`, `whiteSpace`
121
+ Key props: `fontFamily`, `fontSize`, `fontWeight`, `fontStyle`, `lineHeight`, `textAlign`, `textTransform`, `textDecoration`, `letterSpacing`, `whiteSpace` — prefer `lineHeight` scale keys (`base`, `title`, `spacedTitle`) from the theme over raw numbers when possible.
91
122
 
92
123
  ### `system.border`
93
124
 
94
- Border width, style, radius, and color.
125
+ Border width, style, radius, and color. Many logical shorthands exist (`borderX`, `borderColorY`, `borderRadiusTop`, …); see `config.ts` for the full map.
95
126
 
96
- Key props: `border`, `borderTop`, `borderRight`, `borderBottom`, `borderLeft`, `borderRadius`, `borderWidth`, `borderStyle`
127
+ Key props (non-exhaustive): `border`, `borderTop`, `borderRight`, `borderBottom`, `borderLeft`, `borderRadius`, `borderWidth`, `borderStyle`
97
128
 
98
129
  ### `system.background`
99
130
 
@@ -104,7 +135,11 @@ import myBg from './myBg.png';
104
135
 
105
136
  const Box = styled.div(system.background);
106
137
 
107
- <Box background={`url(${myBg})`} backgroundSize="cover" backgroundPosition="center" />;
138
+ <Box
139
+ background={`url(${myBg})`}
140
+ backgroundSize="cover"
141
+ backgroundPosition="center"
142
+ />;
108
143
  ```
109
144
 
110
145
  Key props: `background`, `backgroundImage`, `backgroundSize`, `backgroundPosition`, `backgroundRepeat`
@@ -113,27 +148,25 @@ Key props: `background`, `backgroundImage`, `backgroundSize`, `backgroundPositio
113
148
 
114
149
  Flexbox child and container properties.
115
150
 
116
- Key props: `flex`, `flexDirection`, `flexWrap`, `flexGrow`, `flexShrink`, `flexBasis`, `alignItems`, `alignSelf`, `justifyContent`, `justifySelf`, `gap`, `rowGap`, `columnGap`
151
+ Key props (non-exhaustive): `flex`, `flexDirection`, `flexWrap`, `flexGrow`, `flexShrink`, `flexBasis`, `alignItems`, `alignContent`, `alignSelf`, `justifyContent`, `justifyItems`, `justifySelf`, `gap`, `rowGap`, `columnGap`
117
152
 
118
153
  ### `system.grid`
119
154
 
120
155
  CSS Grid container and child properties.
121
156
 
122
- Key props: `gridTemplateColumns`, `gridTemplateRows`, `gridTemplateAreas`, `gridColumn`, `gridRow`, `gridArea`, `gridAutoFlow`
157
+ Key props (non-exhaustive): `gridTemplateColumns`, `gridTemplateRows`, `gridTemplateAreas`, `gridColumn`, `gridRow`, `gridArea`, `gridAutoFlow`, `gridAutoColumns`, `gridAutoRows`, `gap`, `rowGap`, `columnGap`
123
158
 
124
159
  ### `system.positioning`
125
160
 
126
- Position and offset properties.
161
+ Position and offset properties. Inset shorthands use `transformSize`; physical vs logical edges follow `useLogicalProperties`.
127
162
 
128
163
  ```tsx
129
- const Overlay = styled.div(
130
- variance.compose(system.layout, system.positioning)
131
- );
164
+ const Overlay = styled.div(variance.compose(system.layout, system.positioning));
132
165
 
133
166
  <Overlay position="absolute" top={0} left={0} width="100%" height="100%" />;
134
167
  ```
135
168
 
136
- Key props: `position`, `top`, `right`, `bottom`, `left`, `zIndex`
169
+ Key props: `position`, `inset`, `top`, `right`, `bottom`, `left`, `zIndex`, `opacity`
137
170
 
138
171
  ### `system.shadow`
139
172
 
@@ -141,18 +174,35 @@ Box and text shadow.
141
174
 
142
175
  Key props: `boxShadow`, `textShadow`
143
176
 
177
+ ### `system.list`
178
+
179
+ List marker styling (`listStyle`, `listStyleType`, `listStylePosition`, `listStyleImage`). Included on `Box` alongside the other composed groups.
180
+
144
181
  ## Responsive values
145
182
 
146
- All system props accept an **array of values** for responsive breakpoints (Gamut uses a mobile-first approach):
183
+ All system props accept responsive values mobile-first (min-width queries). Two shapes are supported:
184
+
185
+ ### Object syntax
186
+
187
+ Keys are breakpoints; `_` is the base (no breakpoint). Includes `xs`, `sm`, `md`, `lg`, `xl`, and container keys `c_xs` … `c_xl`.
147
188
 
148
189
  ```tsx
149
- // [mobile, tablet, desktop]
150
- <Box width={['100%', '50%', '33%']} p={[8, 16, 24]} />;
190
+ <Box width={{ _: '100%', sm: '50%', md: '33%' }} px={{ _: 8, md: 16 }} />
151
191
  ```
152
192
 
193
+ ### Array syntax
194
+
195
+ Slots map in order to: base, `xs`, `sm`, `md`, `lg`, `xl`, then `c_xs` … `c_xl`. Leave a slot empty (or use `undefined`) to skip a breakpoint.
196
+
197
+ ```tsx
198
+ <Box width={['100%', , '50%']} p={[8, 16, , 24]} />
199
+ ```
200
+
201
+ Full typings and behavior: [Responsive properties (Storybook)](https://gamut.codecademy.com/storybook/?path=/docs-foundations-system-responsive-properties--page).
202
+
153
203
  ## Using `css()` for styled definitions
154
204
 
155
- For static styles in styled components, use `css()` from `@codecademy/gamut-styles`:
205
+ For static styles in styled components, use `css()` from `@codecademy/gamut-styles` (same implementation as `system.css` on the `system` namespace).
156
206
 
157
207
  ```tsx
158
208
  import { css } from '@codecademy/gamut-styles';
@@ -168,6 +218,8 @@ const Text = styled.div(css({ color: 'primary', p: 4 }));
168
218
  ## Key principles
169
219
 
170
220
  - Compose `system.*` groups via `variance.compose()` — don't apply multiple groups by chaining `styled.div(system.a)(system.b)`.
171
- - Use `system.color` (semantic aliases) for colors that need to adapt to dark/light mode; use raw tokens only for colors that should stay fixed regardless of mode.
172
- - Use `system.space` values that reference the spacing scale rather than arbitrary pixel values to maintain visual rhythm.
173
- - For background images/patterns use `system.background`; for solid background colors that may switch mode use `<Background>` from ColorMode.
221
+ - Prefer semantic color names on `system.color` (e.g. `bg="background"`, `textColor="text"`) so values track ColorMode; use raw palette keys only when the design should stay fixed across modes.
222
+ - Use `bg` with semantic tokens for most mode-aware surfaces; use `<Background>` from `@codecademy/gamut-styles` when you need its contrast- and mode-aware behavior, not for every tinted panel.
223
+ - Use `system.space` values on the spacing scale rather than arbitrary pixel strings to keep rhythm consistent.
224
+ - For background images/patterns use `system.background`; for solid fills use `system.color` / semantic `bg` (or `Background` when that component’s behavior is required).
225
+ - For reusable variants or boolean states on styled primitives, use `variant` / `states` from `@codecademy/gamut-styles` and expose props with `StyleProps<typeof …>` from `@codecademy/variance` — see [Best practices](../../../../styleguide/src/lib/Meta/Best%20practices.mdx).