Skip to content

Commit fe79563

Browse files
authored
Merge pull request #567 from yurm04/theme-preset-polaris
Add new theme preset based on Shopify's Polaris design system
2 parents 03f5106 + e283fb5 commit fe79563

File tree

6 files changed

+99
-1
lines changed

6 files changed

+99
-1
lines changed

packages/preset-polaris/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# [@theme-ui/preset-polaris](https://theme-ui.com/presets/polaris)
2+
3+
Theme UI includes `@theme-ui/preset-polaris` which can be used as an example or
4+
starting point for extending your own themes. `@theme-ui/preset-polaris` is based on the Shopify design system, [Polaris](https://polaris.shopify.com/design/colors).
5+
6+
```sh
7+
npm i @theme-ui/preset-polaris
8+
```
9+
10+
```jsx
11+
// example theme
12+
import theme from '@theme-ui/preset-polaris'
13+
14+
export default {
15+
...theme,
16+
styles: {
17+
...theme,
18+
},
19+
}
20+
```
21+
22+
[See all built-in presets][demo]
23+
24+
## Contributing
25+
26+
We'd love to have more presets added to the Theme UI project.
27+
If you'd like to add a new preset or improve upon the existing ones, please open an [issue][] or [pull request][].
28+
29+
[issue]: https://github.com/system-ui/theme-ui/issues
30+
[pull request]: https://github.com/system-ui/theme-ui/pulls
31+
32+
[demo]: https://theme-ui.com/demo
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../../babel.config')

packages/preset-polaris/package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@theme-ui/preset-polaris",
3+
"version": "0.1.0",
4+
"main": "dist/index.js",
5+
"module": "dist/index.esm.js",
6+
"author": "Yuraima Estevez",
7+
"license": "MIT",
8+
"scripts": {
9+
"prepare": "microbundle --no-compress",
10+
"watch": "microbundle watch --no-compress"
11+
},
12+
"dependencies": {
13+
"@theme-ui/preset-base": "^0.2.44"
14+
},
15+
"publishConfig": {
16+
"access": "public"
17+
}
18+
}

packages/preset-polaris/src/index.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import base from '@theme-ui/preset-base'
2+
3+
const text =
4+
'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif'
5+
6+
export const polaris = {
7+
...base,
8+
colors: {
9+
text: '#454f5b',
10+
background: '#fff',
11+
primary: '#5c6ac4',
12+
secondary: '#006fbb',
13+
highlight: '#47c1bf',
14+
muted: '#e6e6e6',
15+
gray: '#dfe3e8',
16+
accent: '#f49342',
17+
darken: '#00044c',
18+
modes: {
19+
dark: {
20+
text: '#3e4155',
21+
background: '#000639',
22+
primary: '#9c6ade',
23+
secondary: '#b4e1fa',
24+
highlight: '#b7ecec',
25+
muted: '#e6e6e6',
26+
},
27+
},
28+
},
29+
fonts: {
30+
body: text,
31+
heading: text,
32+
moonospace: 'Menlo, monospace',
33+
},
34+
fontWeights: {
35+
body: 400,
36+
heading: 600,
37+
bold: 700,
38+
},
39+
lineHeights: {
40+
body: 1.75,
41+
heading: 1.25,
42+
},
43+
}
44+
45+
export default polaris

packages/presets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"@theme-ui/preset-swiss": "^0.2.40",
2222
"@theme-ui/preset-system": "^0.2.40",
2323
"@theme-ui/preset-tailwind": "^0.2.42",
24-
"@theme-ui/preset-tosh": "^0.2.40"
24+
"@theme-ui/preset-tosh": "^0.2.40",
25+
"@theme-ui/preset-polaris": "^0.1.0"
2526
},
2627
"publishConfig": {
2728
"access": "public"

packages/presets/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ export { default as tosh } from '@theme-ui/preset-tosh'
1010

1111
export { default as bootstrap } from '@theme-ui/preset-bootstrap'
1212
export { default as bulma } from '@theme-ui/preset-bulma'
13+
export { default as polaris } from '@theme-ui/preset-polaris'
1314
export { default as tailwind } from '@theme-ui/preset-tailwind'

0 commit comments

Comments
 (0)