Replies: 1 comment
-
The correct syntax is theme(‘colors.navy.50’), not using dashes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have created a preset for a client that contains an enormous colour palette. Various projects will only use a subset of those colours. I am looking for the best way to reuse those colours and the
theme
function is posing issues.As you'll see in this preview, the direct reference (
synergy.theme.colors.navy[80]
) results in a colour preview with Tailwind CSS Intellisense. The correct method (theme('colors-navy-50')
) does not work so great.Additionally, when trying to tidy up the theme file by nesting the colour variants I can only use the direct reference. Using a the
theme
helper creates an error.This works ✅
This explodes ❌ (
error - ./styles/tailwind.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ref--5-oneOf-6-2!./styles/tailwind.css) RangeError: Maximum call stack size exceeded
)Beta Was this translation helpful? Give feedback.
All reactions