@@ -15,7 +15,7 @@ Similar to the tailwindcss configurations you are used to. It is also possible t
1515## Highlights
1616
1717- Variables are as easy as defining tailwindcss colors...
18- - You can designate the variables to ` :root ` or custom CSS selectors.
18+ - You can designate the variables to ` :root ` , ` :host ` or custom CSS selectors.
1919- Variables can be formed through using nested object notation.
2020- Different variables can be composed for the Dark Mode.
2121- Dark Mode variables are set automatically through the ` class ` or ` media ` modes on your configuration.
@@ -608,14 +608,14 @@ module.exports = {
608608** Purge:**
609609
610610``` html
611- <div class =" text-primary text- opacity-50" ></div >
612- <div class =" bg-secondary bg- opacity-50" ></div >
613- <div class =" bg-gray bg- opacity-50" ></div >
614- <div class =" text-blue text- opacity-50" ></div >
611+ <div class =" text-opacity-50 text-primary " ></div >
612+ <div class =" bg-opacity-50 bg-secondary " ></div >
613+ <div class =" bg-opacity-50 bg-gray " ></div >
614+ <div class =" text-opacity-50 text-blue " ></div >
615615<div class =" bg-red-400" ></div >
616616<div class =" bg-red-500" ></div >
617617<div class =" bg-red-600" ></div >
618- <div class =" bg-green bg- opacity-50" ></div >
618+ <div class =" bg-opacity-50 bg-green " ></div >
619619<div class =" bg-white bg-opacity-50" ></div >
620620```
621621** Output:**
@@ -784,6 +784,40 @@ module.exports = {
784784}
785785```
786786
787+ ### useHost
788+
789+ If ` useHost ` is set to ` true ` , ` :host ` is used instead of ` :root ` for variables injection.
790+
791+ #### Config
792+
793+ ``` javascript
794+ // tailwind.config.js
795+
796+ module .exports = {
797+ theme: {
798+ variables: {
799+ DEFAULT : {
800+ colors: {
801+ green: ' #11ff00' ,
802+ },
803+ },
804+ },
805+ },
806+ plugins: [
807+ require (' @mertasan/tailwindcss-variables' )({
808+ useHost: true ,
809+ })
810+ ]
811+ }
812+ ```
813+
814+ ** Output:**
815+
816+ ``` css
817+ :host {
818+ --colors-green : #11ff00 ;
819+ }
820+ ```
787821
788822### extendColors for colorVariable
789823
0 commit comments