Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokens Studio support 🎉 #30

Merged
merged 2 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/chatty-queens-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@cobalt-ui/core': minor
'@cobalt-ui/cli': minor
---

Deprecate Figma sync CLI and core functionality (in favor of Tokens Studio support)
6 changes: 6 additions & 0 deletions .changeset/clever-rats-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@cobalt-ui/core': minor
'@cobalt-ui/cli': minor
---

Add Tokens Studio support
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.3/schema.json",
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": ["@changesets/changelog-github", {"repo": "drwpow/cobalt-ui"}],
"commit": false,
"linked": [],
Expand Down
5 changes: 5 additions & 0 deletions .changeset/spotty-mirrors-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cobalt-ui/core': patch
---

Fix bug where $value: `0` wasn’t a valid value
12 changes: 6 additions & 6 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"dev:serve": "astro dev"
},
"devDependencies": {
"@cobalt-ui/cli": "^1.0.0",
"@cobalt-ui/core": "^1.0.0",
"@cobalt-ui/plugin-css": "^1.2.0",
"@cobalt-ui/plugin-sass": "^1.2.0",
"astro": "^2.5.4",
"@cobalt-ui/cli": "workspace:^",
"@cobalt-ui/core": "workspace:^",
"@cobalt-ui/plugin-css": "workspace:^",
"@cobalt-ui/plugin-sass": "workspace:^",
"astro": "^2.5.7",
"npm-run-all": "^4.1.5",
"sass": "^1.62.1",
"shiki": "^0.14.2",
"vite": "^4.3.8"
"vite": "^4.3.9"
}
}
Binary file added docs/public/images/tokens-studio-for-figma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 34 additions & 34 deletions docs/src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,45 @@ import CobaltSm from './CobaltSm.astro';
---

<style lang="scss">
@use "../../tokens" as *;
@use '../../tokens' as *;

.footer {
border-top: 1px solid currentColor;
display: grid;
grid-template-columns: auto auto;
grid-gap: 2rem;
margin-top: 2rem;
padding-bottom: 6rem;
padding-top: 1.5rem;
}
.footer {
border-top: 1px solid currentColor;
display: grid;
grid-template-columns: auto auto;
grid-gap: 2rem;
margin-top: 2rem;
padding-bottom: 6rem;
padding-top: 1.5rem;
}

.ensignia {
align-items: center;
align-self: flex-start;
display: grid;
font-size: token('font.size.05');
font-weight: 500;
grid-gap: token('space.sm');
grid-template-columns: min-content min-content;
}
.ensignia {
align-items: center;
align-self: flex-start;
display: grid;
font-size: token('font.size.05');
font-weight: 500;
grid-gap: token('space.sm');
grid-template-columns: min-content min-content;
}

.license {
font-size: token('font.size.04');
margin-top: token('space.sm');
}
.license {
font-size: token('font.size.04');
margin-top: token('space.sm');
}

nav {
display: flex;
flex-direction: column;
margin-left: auto;
width: 8rem;
nav {
display: flex;
flex-direction: column;
margin-left: auto;
width: 8rem;

a {
display: block;
margin: 0.25em 0;
text-decoration: none;
}
}
a {
display: block;
margin: 0.25em 0;
text-decoration: none;
}
}
</style>

<div class="wrapper">
Expand Down
2 changes: 0 additions & 2 deletions docs/src/components/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ let {title = 'Cobalt'} = Astro.props;
<h1>{title}</h1>
</a>
<nav class="nav">
<a class="a" href="/docs/getting-started" aria-current={currentPage === '/docs/getting-started' || currentPage.startsWith('/docs') || undefined}> Docs</a>
<a class="a" href="/editor" aria-current={currentPage === '/editor' || undefined}>Editor</a>
<a class="a a--github" href="https://github.com/drwpow/cobalt-ui">
<svg class="github-icon"><use xlink:href="#github"></use></svg>
</a>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/docs-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
{"title": "Guides", "pathname": "/docs/guides"},
{"title": "Best Practices", "pathname": "/docs/guides/best-practices"},
{"title": "Modes", "pathname": "/docs/guides/modes"},
{"title": "Figma", "pathname": "/docs/guides/figma"},
{"title": "Tokens Studio", "pathname": "/docs/guides/tokens-studio"},
{"title": "Create Plugins", "pathname": "/docs/guides/plugins"},
{"title": "Plugins", "pathname": "/docs/plugins"},
{"title": "CSS", "pathname": "/docs/plugins/css"},
{"title": "Sass", "pathname": "/docs/plugins/sass"},
{"title": "JS/JSON/TS", "pathname": "/docs/plugins/js"},
{"title": "Reference", "pathname": "/docs/reference"},
{"title": "Config", "pathname": "/docs/reference/config"},
{"title": "Config API", "pathname": "/docs/reference/config"},
{"title": "About", "pathname": "/docs/reference/about"}
]
}
2 changes: 2 additions & 0 deletions docs/src/pages/docs/getting-started/generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import pluginJS from '@cobalt-ui/plugin-js';

/** @type import('@cobalt-ui/core').Config */
export default {
tokens: './tokens.json',
outDir: './tokens/',
plugins: [pluginCSS(), pluginJS()],
};
```
Expand Down
12 changes: 7 additions & 5 deletions docs/src/pages/docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ The W3C Community Group’s approach differs in being the [largest collaborative

## Requirements

- [Node.js](https://nodejs.org) v16 or higher (newer is always recommended).
- [Node.js](https://nodejs.org) v18 or higher (newer is always recommended).

## Install

Install the CLI:

```
```bash
npm i -D @cobalt-ui/cli
```

Install any plugins you’d like to use (_note: you must install at least one plugin to generate code_):

```
```bash
npm i -D @cobalt-ui/plugin-css @cobalt-ui/plugin-js @cobalt-ui/plugin-sass
```

Expand All @@ -47,13 +47,15 @@ import pluginCSS from '@cobalt-ui/plugin-css';

/** @type import('@cobalt-ui/core').Config */
export default {
tokens: './tokens.json',
outDir: './tokens/',
plugins: [pluginCSS()],
};
```

Run the following command (**co** being short for “Cobalt”):

```
```bash
npx co build
```

Expand All @@ -62,7 +64,7 @@ This will generate a **tokens/tokens.css** file in your project for you to use.
## Next steps

- [Learn about tokens](/docs/tokens)
- [Sync with Figma](/docs/guides/figma)
- [Sync with Figma using Tokens Studio](/docs/guides/tokens-studio)
- [Learn how to configure Cobalt](/docs/reference/config)
- [Add plugins](/docs/plugins)

Expand Down
Loading