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

[WIP] JSON theme #4443

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8298cb9
Some basic stuff
origami-z Nov 7, 2024
46f839e
Split palette to multiple files
origami-z Nov 11, 2024
b30b23b
Multi modes? not working
origami-z Nov 11, 2024
6684f2c
kebab case tokens.json
origami-z Nov 19, 2024
769fe79
Update with $modes working version for palette.accent.stronger.$modes
origami-z Nov 20, 2024
b721215
Add script to combine multiple tokens files into a single $modes file
origami-z Nov 20, 2024
ccf36f5
Add accent + mode. How to remove accent from uncessary css?
origami-z Nov 20, 2024
a0cf477
Add todo
origami-z Nov 20, 2024
f193634
refactor kebab, remove -default suffix
origami-z Nov 21, 2024
5142f76
Refactor transform to standalone file
origami-z Nov 21, 2024
486531a
Update readme instructions
origami-z Nov 21, 2024
efc85c0
Reduce number of css when blue/teal mode doesn't matter for palette
origami-z Nov 21, 2024
5222d7c
Fix characteristics palette token
origami-z Nov 21, 2024
f059c70
Exclude figma only token in platform filtes filter
origami-z Nov 25, 2024
608ae23
Add readme
origami-z Nov 25, 2024
9691e5b
Refactor files to standalone file
origami-z Nov 25, 2024
b313f5e
Fix build after refactor
origami-z Nov 25, 2024
b047854
Adds characteristics files
origami-z Nov 25, 2024
fbe14eb
Move palette tokens into src folder
origami-z Nov 26, 2024
3fe6718
Fix script
origami-z Nov 26, 2024
b1924d0
Add curve-next tokens
origami-z Nov 26, 2024
31b0eec
Biome fix
origami-z Nov 26, 2024
4a58aa6
Build into existing css palette/-next.css
origami-z Nov 29, 2024
63ff787
Reorder color.tokens, add background prefix to some colors
origami-z Nov 29, 2024
7d1b115
add alph.background prefix to some colors
origami-z Nov 29, 2024
808c9c9
Add foundation color/alpha next to prod css
origami-z Nov 29, 2024
ed06aea
Add slash to tooling/ts package.json
origami-z Nov 29, 2024
3670ac1
Use out of box `css/variables` format
origami-z Nov 29, 2024
d28b2c6
Add formatting to cssMultiModes
origami-z Nov 29, 2024
00f9dd2
Add remaining header formatting
origami-z Nov 29, 2024
72340fc
Adds more palette next css
origami-z Nov 29, 2024
6c9845e
Rename script name
origami-z Nov 29, 2024
711b569
Fix salt-ds/value/px
origami-z Nov 29, 2024
0e8752e
Update file header comment
origami-z Nov 29, 2024
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"react-dom": "^18.3.1",
"rifm": "^0.12.0",
"storybook": "^8.4.4",
"style-dictionary": "^4.1.4",
"style-dictionary-utils": "^4.0.0",
"stylelint": "^16.0.0",
"typescript": "4.6.4",
"vite": "^5.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/theme/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.log
19 changes: 19 additions & 0 deletions packages/theme/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
This is a regular package

---

## Tokens

1. Run "Export Color Styles" -> "Export Variables" -> "Json (Experimental)" from [PR#51](https://github.com/jpmorganchase/Figma-Plugins-and-Widgets/pull/51)
1. Select Collection and Mode on plugin UI
1. Add "Additional Root Key (Optional)"
- Colors library: 'color'
- Palette library: 'palette'
1. Copy output to corresponding `*.tokens.json` file
1. Modify color tokens
1. remove `categorical.` from , e.g. replace `"{color.categorical` to `"{color`
1. added `background.` to a few background color raw tokens

TODOs

- [ ] Custom value tranformer for `foundation/alpha-next.css` tokens, to achieve `rgba` syntax from `packages/theme/css/foundations/alpha-next.css`? Or this may not be needed given we generate these values
- [ ] Better `alpha` foundation color generation, maybe use custom opacity modifier instead
131 changes: 77 additions & 54 deletions packages/theme/css/foundations/alpha-next.css
Original file line number Diff line number Diff line change
@@ -1,57 +1,80 @@
/*
TODO: discuss whether this should be an actual file, or should inline these values.
con: If we offer these values, then it could misleading that we're offering all these values
/**
* Do not edit directly, this file was auto-generated.
*/

.salt-theme.salt-theme-next {
--salt-color-white-10a: rgba(var(--salt-color-white-rgb), 0.1);
--salt-color-white-15a: rgba(var(--salt-color-white-rgb), 0.15);
--salt-color-white-20a: rgba(var(--salt-color-white-rgb), 0.2);
--salt-color-white-30a: rgba(var(--salt-color-white-rgb), 0.3);
--salt-color-white-40a: rgba(var(--salt-color-white-rgb), 0.4);
--salt-color-white-45a: rgba(var(--salt-color-white-rgb), 0.45);
--salt-color-white-70a: rgba(var(--salt-color-white-rgb), 0.7);
--salt-color-black-10a: rgba(var(--salt-color-black-rgb), 0.1);
--salt-color-black-15a: rgba(var(--salt-color-black-rgb), 0.15);
--salt-color-black-20a: rgba(var(--salt-color-black-rgb), 0.2);
--salt-color-black-30a: rgba(var(--salt-color-black-rgb), 0.3);
--salt-color-black-40a: rgba(var(--salt-color-black-rgb), 0.4);
--salt-color-black-45a: rgba(var(--salt-color-black-rgb), 0.45);
--salt-color-black-70a: rgba(var(--salt-color-black-rgb), 0.7);
--salt-color-blue-200-40a: rgba(var(--salt-color-blue-200-rgb), 0.4);
--salt-color-blue-300-40a: rgba(var(--salt-color-blue-300-rgb), 0.4);
--salt-color-blue-400-40a: rgba(var(--salt-color-blue-400-rgb), 0.4);
--salt-color-blue-500-40a: rgba(var(--salt-color-blue-500-rgb), 0.4);
--salt-color-blue-600-40a: rgba(var(--salt-color-blue-600-rgb), 0.4);
--salt-color-blue-700-40a: rgba(var(--salt-color-blue-700-rgb), 0.4);
--salt-color-blue-800-40a: rgba(var(--salt-color-blue-800-rgb), 0.4);
--salt-color-gray-300-10a: rgba(var(--salt-color-gray-300-rgb), 0.1);
--salt-color-gray-300-40a: rgba(var(--salt-color-gray-300-rgb), 0.4);
--salt-color-gray-400-40a: rgba(var(--salt-color-gray-400-rgb), 0.4);
--salt-color-gray-500-10a: rgba(var(--salt-color-gray-500-rgb), 0.1);
--salt-color-gray-500-40a: rgba(var(--salt-color-gray-500-rgb), 0.4);
--salt-color-gray-600-40a: rgba(var(--salt-color-gray-600-rgb), 0.4);
--salt-color-gray-700-10a: rgba(var(--salt-color-gray-700-rgb), 0.1);
--salt-color-gray-700-40a: rgba(var(--salt-color-gray-700-rgb), 0.4);
--salt-color-green-400-40a: rgba(var(--salt-color-green-400-rgb), 0.4);
--salt-color-green-500-40a: rgba(var(--salt-color-green-500-rgb), 0.4);
--salt-color-green-600-40a: rgba(var(--salt-color-green-600-rgb), 0.4);
--salt-color-orange-400-40a: rgba(var(--salt-color-orange-400-rgb), 0.4);
--salt-color-orange-500-40a: rgba(var(--salt-color-orange-500-rgb), 0.4);
--salt-color-orange-600-40a: rgba(var(--salt-color-orange-600-rgb), 0.4);
--salt-color-red-400-40a: rgba(var(--salt-color-red-400-rgb), 0.4);
--salt-color-red-500-40a: rgba(var(--salt-color-red-500-rgb), 0.4);
--salt-color-red-600-40a: rgba(var(--salt-color-red-600-rgb), 0.4);
--salt-color-teal-200-40a: rgba(var(--salt-color-teal-200-rgb), 0.4);
--salt-color-teal-300-40a: rgba(var(--salt-color-teal-300-rgb), 0.4);
--salt-color-teal-400-40a: rgba(var(--salt-color-teal-400-rgb), 0.4);
--salt-color-teal-500-40a: rgba(var(--salt-color-teal-500-rgb), 0.4);
--salt-color-teal-600-40a: rgba(var(--salt-color-teal-600-rgb), 0.4);
--salt-color-teal-700-40a: rgba(var(--salt-color-teal-700-rgb), 0.4);
--salt-color-teal-800-40a: rgba(var(--salt-color-teal-800-rgb), 0.4);
--salt-color-background-snow-40a: rgba(var(--salt-color-background-snow-rgb), 0.4);
--salt-color-background-marble-40a: rgba(var(--salt-color-background-marble-rgb), 0.4);
--salt-color-background-limestone-40a: rgba(var(--salt-color-background-limestone-rgb), 0.4);
--salt-color-background-granite-40a: rgba(var(--salt-color-background-granite-rgb), 0.4);
--salt-color-background-jet-40a: rgba(var(--salt-color-background-jet-rgb), 0.4);
--salt-color-background-leather-40a: rgba(var(--salt-color-background-leather-rgb), 0.4);
--salt-color-white-0a: rgba(255, 255, 255, 0);
--salt-color-white-5a: rgba(255, 255, 255, 0.05);
--salt-color-white-10a: rgba(255, 255, 255, 0.1);
--salt-color-white-15a: rgba(255, 255, 255, 0.15);
--salt-color-white-20a: rgba(255, 255, 255, 0.2);
--salt-color-white-25a: rgba(255, 255, 255, 0.25);
--salt-color-white-30a: rgba(255, 255, 255, 0.3);
--salt-color-white-35a: rgba(255, 255, 255, 0.35);
--salt-color-white-40a: rgba(255, 255, 255, 0.4);
--salt-color-white-45a: rgba(255, 255, 255, 0.45);
--salt-color-white-50a: rgba(255, 255, 255, 0.5);
--salt-color-white-55a: rgba(255, 255, 255, 0.55);
--salt-color-white-60a: rgba(255, 255, 255, 0.6);
--salt-color-white-65a: rgba(255, 255, 255, 0.65);
--salt-color-white-70a: rgba(255, 255, 255, 0.7);
--salt-color-white-75a: rgba(255, 255, 255, 0.75);
--salt-color-white-80a: rgba(255, 255, 255, 0.8);
--salt-color-black-0a: rgba(0, 0, 0, 0);
--salt-color-black-5a: rgba(0, 0, 0, 0.05);
--salt-color-black-10a: rgba(0, 0, 0, 0.1);
--salt-color-black-15a: rgba(0, 0, 0, 0.15);
--salt-color-black-20a: rgba(0, 0, 0, 0.2);
--salt-color-black-25a: rgba(0, 0, 0, 0.25);
--salt-color-black-30a: rgba(0, 0, 0, 0.3);
--salt-color-black-35a: rgba(0, 0, 0, 0.35);
--salt-color-black-40a: rgba(0, 0, 0, 0.4);
--salt-color-black-45a: rgba(0, 0, 0, 0.45);
--salt-color-black-50a: rgba(0, 0, 0, 0.5);
--salt-color-black-55a: rgba(0, 0, 0, 0.55);
--salt-color-black-60a: rgba(0, 0, 0, 0.6);
--salt-color-black-65a: rgba(0, 0, 0, 0.65);
--salt-color-black-70a: rgba(0, 0, 0, 0.7);
--salt-color-black-75a: rgba(0, 0, 0, 0.75);
--salt-color-black-80a: rgba(0, 0, 0, 0.8);
--salt-color-blue-200-40a: rgba(199, 222, 255, 0.4);
--salt-color-blue-300-40a: rgba(154, 189, 245, 0.4);
--salt-color-blue-400-40a: rgba(102, 156, 232, 0.4);
--salt-color-blue-500-40a: rgba(0, 120, 207, 0.4);
--salt-color-blue-500-0a: rgba(0, 120, 207, 0);
--salt-color-blue-600-40a: rgba(0, 94, 166, 0.4);
--salt-color-blue-700-40a: rgba(0, 69, 126, 0.4);
--salt-color-blue-800-40a: rgba(0, 45, 89, 0.4);
--salt-color-gray-300-40a: rgba(177, 181, 185, 0.4);
--salt-color-gray-400-10a: rgba(145, 149, 154, 0.1);
--salt-color-gray-400-40a: rgba(145, 149, 154, 0.4);
--salt-color-gray-500-0a: rgba(114, 119, 125, 0);
--salt-color-gray-500-10a: rgba(114, 119, 125, 0.1);
--salt-color-gray-500-40a: rgba(114, 119, 125, 0.4);
--salt-color-gray-600-10a: rgba(95, 100, 106, 0.1);
--salt-color-gray-600-40a: rgba(97, 102, 108, 0.4);
--salt-color-gray-700-40a: rgba(76, 81, 87, 0.4);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

??? Why gray 600 10a/40a not same RGB

--salt-color-orange-400-40a: rgba(232, 122, 56, 0.4);
--salt-color-orange-500-40a: rgba(199, 83, 0, 0.4);
--salt-color-orange-600-40a: rgba(163, 68, 0, 0.4);
--salt-color-red-400-40a: rgba(255, 93, 87, 0.4);
--salt-color-red-500-40a: rgba(229, 33, 53, 0.4);
--salt-color-red-600-40a: rgba(186, 23, 41, 0.4);
--salt-color-teal-200-40a: rgba(175, 224, 237, 0.4);
--salt-color-teal-300-40a: rgba(131, 192, 214, 0.4);
--salt-color-teal-400-40a: rgba(76, 161, 194, 0.4);
--salt-color-teal-500-40a: rgba(27, 127, 158, 0.4);
--salt-color-teal-500-0a: rgba(27, 127, 158, 0);
--salt-color-teal-600-40a: rgba(18, 100, 126, 0.4);
--salt-color-teal-700-40a: rgba(9, 74, 96, 0.4);
--salt-color-teal-800-40a: rgba(3, 49, 66, 0.4);
--salt-color-green-400-40a: rgba(83, 176, 135, 0.4);
--salt-color-green-500-40a: rgba(0, 135, 93, 0.4);
--salt-color-green-600-40a: rgba(0, 107, 72, 0.4);
--salt-color-background-snow-40a: rgba(255, 255, 255, 0.4);
--salt-color-background-marble-40a: rgba(242, 244, 246, 0.4);
--salt-color-background-limestone-40a: rgba(250, 248, 242, 0.4);
--salt-color-background-charcoal-40a: rgba(71, 76, 80, 0.4);
--salt-color-background-leather-40a: rgba(38, 41, 43, 0.4);
--salt-color-background-jet-40a: rgba(16, 24, 32, 0.4);
}
Loading
Loading