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

Adds Tailwind as an export option #1

Open
wants to merge 69 commits into
base: develop
Choose a base branch
from

Conversation

andrewfulton
Copy link
Owner

Would like to be able to generate a tailwind.config file from the tokens generated from the figma file.

Not sure whether it will support everything in the same way chakra does but might at least get us some of the way there.

Generated file is currently empty, have just added the new
generate-tailwind command without processing any tokens.
Includes a local command as figma is likely to contain everything
TW wants and we may need some local additions wihout getting clobbered
on each export
@@ -0,0 +1,8 @@
// AUTO-GENERATED - File generated by figma2theme <%- version %>, manual edits may be overwritten
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear at the moment why format-on-save is indenting this file, but not the other.

@andrewfulton andrewfulton changed the title /feat Scaffolds of command for exporting a tailwind config file. Adds Tailwind as an export option Feb 12, 2022
… config

Most of it is now present in the output, barring a few that I'm not quite sure
what to do with yet
@andrewfulton
Copy link
Owner Author

Things I am not quite sure how to translate yet:

  • gridStyles There are some grid configs in TW but not sure they work the same way.
  • icons
  • sizes We have spacing, not sure how it incorporate sizes.

// Run Prettier on JS code using the config file
const formatFileContents = async (contents: string) => {
return prettier.resolveConfig(prettierConfigFile).then((options) => {
return prettier.format(contents, { ...options, parser: 'babel' });
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if there is a more correct parser option here but it din't like it when I left it out

// This takes the responsive textStyles that get applied in a system like Chakra
// and translates them into a set of responsive styles at the various breakpoints
// defined in the theme.
export const generateResponsiveTextStyles = (
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is the best way to get an equivalent to the responsive text styles that the toolkit defines and Chakra knows what do to with, but the alternative seems to be managing the utility classes for each breakpoint manually, which may be the more Tailwind way to do it, but could lead to things being missed pretty easily depending on how it's implemented.

Also not sure yet if we can use @apply and other tailwind utility classes in these definitions. That might make them a little less verbose?

spykr and others added 24 commits February 16, 2022 15:46
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.5 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.14.5...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
…t/npm_and_yarn/follow-redirects-1.14.8

Bump follow-redirects from 1.14.5 to 1.14.8
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
…t/npm_and_yarn/minimist-1.2.6

Bump minimist from 1.2.5 to 1.2.6
Bumps [@emotion/react](https://github.com/emotion-js/emotion) from 11.9.0 to 11.9.3.
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/[email protected]...@emotion/[email protected])

---
updated-dependencies:
- dependency-name: "@emotion/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…t/npm_and_yarn/emotion/react-11.9.3

Bump @emotion/react from 11.9.0 to 11.9.3
Bumps [@emotion/styled](https://github.com/emotion-js/emotion) from 11.8.1 to 11.9.3.
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/[email protected]...@emotion/[email protected])

---
updated-dependencies:
- dependency-name: "@emotion/styled"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…t/npm_and_yarn/emotion/styled-11.9.3

Bump @emotion/styled from 11.8.1 to 11.9.3
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
EllyLoel and others added 30 commits November 7, 2022 15:13
…tableStudios/figma2theme into feature/export-css-custom-properties
- refactor code to move `$type` property in to each token
- update token types to match the new structure
- add JSON examples for each token dictionary
- refactor code to use new token types
- update all `reduce` calls to add an explicit return type
- update tests to account for `$type` change
…stom-properties

# Conflicts:
#	src/export/export-chakra.ts
…tableStudios/figma2theme into feature/export-css-custom-properties
…xport-css-custom-properties

Export CSS custom properties
…ate-gitignore

🧹 chore: updating gitignore file
…esign-token-format

Update design token format
…support-icons-and-media

feat(UIKIT-17): update to support new page name "Icons & Media"
…s-page-optional

feat: make the "sizes" page optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants