Skip to content
This repository was archived by the owner on Jul 14, 2023. It is now read-only.

Commit 764f36c

Browse files
committed
MVP for the design concepts documentation.
1 parent 204d00d commit 764f36c

File tree

12 files changed

+109
-19
lines changed

12 files changed

+109
-19
lines changed

apps/docs/src/components/Footer/Footer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Footer: React.FC = () => {
99
<Box marginTop="2">
1010
<Text size="small">
1111
Copyright ©{new Date().getFullYear()} under the{' '}
12-
<a href="https://github.com/colinhemphill/strum-design/blob/main/LICENSE.md">
12+
<a href="https://github.com/colinhemphill/strum/blob/main/LICENSE.md">
1313
MIT license
1414
</a>
1515
</Text>

apps/docs/src/components/Header/Header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const Header: React.FC = () => {
3737
</VisuallyHidden>
3838
<Stack alignItems="center" direction="horizontal">
3939
<Box display={{ xs: 'none', md: 'block' }}>
40-
<Link href="https://github.com/colinhemphill/strum-design">
40+
<Link href="https://github.com/colinhemphill/strum">
4141
<VisuallyHidden focusable>GitHub</VisuallyHidden>
4242
<FontAwesomeIcon icon={faGithub} size="lg" />
4343
</Link>

apps/docs/src/components/MainNav/links.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const mobileLinks: NavLink[] = [
1111
{
1212
icon: faGithub,
1313
name: 'GitHub',
14-
route: 'https://github.com/colinhemphill/strum-design',
14+
route: 'https://github.com/colinhemphill/strum',
1515
},
1616
];
1717

apps/docs/src/pages/components/[slug].tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export const getStaticProps: GetStaticProps<StaticProps> = async (context) => {
5454
const componentPathname = pathname.replace('docs.mdx', 'tsx');
5555
const staticTypes = getStaticTypes(componentPathname)[slug] ?? null;
5656

57-
const docsLink = createGitHubLink(pathname.replace(/^\/.*strum-design/i, ''));
57+
const docsLink = createGitHubLink(pathname.replace(/^\/.*strum/i, ''));
5858
const sourceLink = createGitHubLink(
59-
componentPathname.replace(/^\/.*strum-design/i, ''),
59+
componentPathname.replace(/^\/.*strum/i, ''),
6060
);
6161

6262
return {

apps/docs/src/pages/overview/design-concepts.mdx

+61-5
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,74 @@
55

66
## Theming
77

8-
Talk about use of dark and light themes, including default color selections.
8+
Strum's colors and components adapt beautifully to either a light or dark color scheme. Using the <Link href="/components/StrumProvider">StrumProvider</Link> you can either force a light/dark color scheme, or allow the user's system preferences to determine the color scheme. Atomic classes within the design system will then choose the appropriate backgrounds, borders, text colors, and accents to work with the light or dark mode.
9+
10+
Although we have lots of color options you can choose from, we cannot currently take a custom accent color or theme overrides. We'll be working on this possibility in the future.
911

1012
## Design tokens
1113

12-
I'll use this space to talk about atomic properties that you can use. Talk about general design and layout strategies, etc.
14+
Design tokens are used to generate atomic classes that you can access for your custom layouts and components. You can always access these values with the <Link href="/components/Box">Box primitive</Link>.
1315

1416
### Colors
1517

16-
### Spacing
18+
Strum uses two separate color palettes, and you can choose one color from each palette to design your application. The [neutral colors](https://www.radix-ui.com/docs/colors/palette-composition/the-scales#grays) are shades of gray that designate the background colors and hover/focus states of various components. You can choose a completely neutral `gray` or subtle color variants like `slate` or `mauve`.
19+
20+
You also choose an [accent color](https://www.radix-ui.com/docs/colors/palette-composition/the-scales#colors) to fit with your site's branding.
21+
22+
Once you've selected these base color palettes, you'll have access to the following color tokens.
1723

18-
### Layouts
24+
- Accent colors
25+
- `accent1` to `accent12`
26+
- `accentContrast`, either black or white depending on which accent color you've chosen
27+
- `accentTransparent`, a slightly transparent version of your accent color
28+
- Neutral colors
29+
- `neutral1` to `neutral12`
30+
- `neutralTransparent`, a slightly transparent version of your neutral color
31+
- Context colors
32+
- `error1` to `error12`
33+
- `errorContrast`, pure white to contrast the error background color
34+
- `errorTransparent`, a slightly transparent version of the error color
35+
- `successContrast`, pure white to contrast the success background color
36+
- `successTransparent`, a slightly transparent version of the success color
37+
- `warningContrast`, pure black to contrast the warning background color
38+
- `warningTransparent`, a slightly transparent version of the warning color
39+
- CSS values
40+
- `current`, the CSS `currentColor` value
41+
- `inherit`, the CSS `inherit` value
42+
- `transparent`, the CSS `transparent` value
43+
- Plain colors
44+
- `black`, pure black
45+
- `white`, pure white
46+
47+
### Sizing
48+
49+
- Spacers
50+
- `0`
51+
- `1`, `0.25rem` (4px)
52+
- `2`, `0.5rem` (8px)
53+
- `3`, `0.75rem` (12px)
54+
- `4`, `1rem` (16px)
55+
- `5`, `1.5rem` (24px)
56+
- `6`, `2rem` (32px)
57+
- `7`, `2.5rem` (40px)
58+
- `8`, `3rem` (48px)
59+
- `9`, `4rem` (64px)
60+
- `10`, `5rem` (80px)
61+
- `11`, `6rem` (96px)
62+
- `12`, `8rem` (128px)
63+
- CSS values
64+
- `auto`, CSS `auto` value
65+
- `full`, CSS `100%` value
66+
- `fitContent`, CSS `fit-content` value
67+
- `maxContent`, CSS `max-content` value
68+
- `maxContent`, CSS `min-content` value
69+
- `100vh`, CSS `100vh` value
70+
- `100vw`, CSS `100vw` value
71+
- `gapX`, `2rem`, equal to the horizontal gap/padding sizes used across the app, such as containers
72+
- `gapY`, `2rem`
1973

2074
## Accessibility
2175

22-
Talk about component and color accessibility.
76+
Strum is highly focused on making sure that interactive and non-interactive elements are built with accessibility in mind. We often require certain props that are necessary for the component to take advantage of these accessibility features, and we sometimes choose to compromise slightly on a visual choice in favor of accessibility. For example, we've modified the Radix colors at step `9` for better color contrast.
77+
78+
These features will always take priority, so please open an issue or a pull request on our [GitHub repo](https://github.com/colinhemphill/strum) if something doesn't meet an accessibility standard that we should be meeting.

apps/docs/src/pages/overview/development.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
## Development guidelines
77

8-
Our [GitHub source](https://github.com/colinhemphill/strum-design) is a monorepo containing this docs app and the React library. The README should include any relevant tips for running the project locally and working on it. Please feel free to
8+
Our [GitHub source](https://github.com/colinhemphill/strum) is a monorepo containing this docs app and the React library. The README should include any relevant tips for running the project locally and working on it. Please feel free to
99

1010
Strum Design System is the personal component library for <a href="https://colinhemphill.com">Colin Hemphill</a>, a front end dev in Austin, TX. I cannot guarantee any availability to work on this project, but you are welcome to post issues or make pull requests and I'll try to get to it if I can.
1111

1212
```bash
13-
git clone [email protected]:colinhemphill/strum-design.git
14-
cd strum-design
13+
git clone [email protected]:colinhemphill/strum.git
14+
cd strum
1515
yarn
1616
yarn dev
1717
```

apps/docs/src/utils/github.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const createGitHubLink = (path = '') => {
22
const repo = `${process.env.VERCEL_GIT_REPO_OWNER ?? 'colinhemphill'}/${
3-
process.env.VERCEL_GIT_REPO_SLUG ?? 'strum-design'
3+
process.env.VERCEL_GIT_REPO_SLUG ?? 'strum'
44
}`;
55
const branch = process.env.VERCEL_GIT_COMMIT_REF ?? 'main';
66
return `https://github.com/${repo}/tree/${branch}${path?.replace(

packages/strum-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/colinhemphill/strum-design.git"
8+
"url": "https://github.com/colinhemphill/strum.git"
99
},
1010
"homepage": "https://strum.design",
1111
"keywords": [

packages/strum-react/src/components/Box/Box.docs.mdx

+33
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,39 @@ import { Box } from '@strum/react';
1212
<Box>Hello world</Box>
1313
```
1414

15+
You can use the Box primitive to create a DOM element that applies any of the available <Link href="/overview/design-concepts#design-tokens">design tokens</Link>.
16+
17+
```tsx live name="box primitive examples"
18+
<Box
19+
alignItems="center"
20+
backgroundColor="neutral4"
21+
borderRadius="large"
22+
color="neutral12"
23+
display="flex"
24+
justifyContent="space-between"
25+
padding="6"
26+
>
27+
<Box
28+
borderWidth="2"
29+
borderStyle="solid"
30+
borderRadius="medium"
31+
color="accent11"
32+
padding="2"
33+
>
34+
Hello world
35+
</Box>
36+
<Box
37+
borderWidth="2"
38+
borderStyle="solid"
39+
borderRadius="medium"
40+
color="accent11"
41+
padding="2"
42+
>
43+
Hello world
44+
</Box>
45+
</Box>
46+
```
47+
1548
## Props
1649

1750
`React.AllHTMLAttributes` properties are supported, but not listed below for brevity.

packages/strum-react/src/components/Button/Button.docs.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Button } from '@strum/react';
1414

1515
## Props
1616

17-
If rendereding as a `<button>`, the component will also pass through intrinsic props `onClick`, `onMouseEnter`, `onMouseLeave`, `disabled`, `type`, and `tabIndex`. If rendereding as an anchor, the component will pass through `href`, `rel`, and `target`.
17+
If rendering as a `<button>`, the component will also pass through intrinsic props `onClick`, `onMouseEnter`, `onMouseLeave`, `disabled`, `type`, and `tabIndex`. If rendering as an anchor, the component will pass through `href`, `rel`, and `target`.
1818

1919
<PropsTable sourceLink={sourceLink} types={types} />
2020

@@ -79,7 +79,7 @@ By default, buttons will render as a semantic `<button>` element. To style a lin
7979
<Button
8080
color="transparent"
8181
as="a"
82-
href="https://github.com/colinhemphill/strum-design"
82+
href="https://github.com/colinhemphill/strum"
8383
target="_blank"
8484
rel="noopener noreferrer"
8585
>

packages/strum-react/src/css/globals.css.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ globalStyle('a', {
1010
color: 'inherit',
1111
textDecoration: 'underline',
1212
textDecorationColor: vars.accent.accent9,
13-
textUnderlineOffset: '0.2em',
13+
textUnderlineOffset: '0.125em',
14+
textDecorationThickness: '0.125em',
1415
});
1516

1617
globalStyle('a:hover', {

packages/strum-react/src/tokens/space.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const space = {
2929
'12': '8rem',
3030
auto: 'auto',
3131
full: '100%',
32-
fit: 'fit-content',
32+
fitContent: 'fit-content',
3333
maxContent: 'max-content',
3434
minContent: 'min-content',
3535
'100vh': '100vh',

0 commit comments

Comments
 (0)