Where is the Code located that converts strings to css code? #7724
Replies: 5 comments
-
Hey! All of Tailwind's core plugins are in this file — here's an example plugin for classes like https://github.com/tailwindlabs/tailwindcss/blob/master/src/corePlugins.js#L1470-L1479 They use the same public plugin APIs that third-party plugins use, documented here: https://tailwindcss.com/docs/plugins#dynamic-utilities We have some internal helpers like https://github.com/tailwindlabs/tailwindcss/blob/master/src/corePlugins.js#L499-L505 But again that's just a function that calls https://github.com/tailwindlabs/tailwindcss/blob/master/src/util/createUtilityPlugin.js |
Beta Was this translation helpful? Give feedback.
-
Actually, I am asking about with regards to JIT. Here is my assumption of how tailwindcss works: For example: <div class="w-2"></div> Tailwind extracts the classes which are "w-2" and generates the CSS which is ".w-2 {width: 0.5rem;}" and the CSS is injected into document. Assuming my assumptions are correct my question is: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Answer I already gave is what you’re looking for. There’s nothing that is as simple/direct as What you’re looking for is pretty much the whole codebase I’m afraid 😅 |
Beta Was this translation helpful? Give feedback.
-
Thanks, Adam :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For example given a string "w-2" it should return ".w-2 {width: 0.5rem;}"
For example given a string "h-2" it should return ".h-2 {height: 0.5rem;}"
Beta Was this translation helpful? Give feedback.
All reactions