[{"data":1,"prerenderedAt":185},["ShallowReactive",2],{"\u002Fblog\u002Fexport-variables-from-css-modules-into-sfcs":3,"\u002Fblog\u002Fexport-variables-from-css-modules-into-sfcs-neighbours":154},{"id":4,"title":5,"body":6,"date":140,"description":141,"extension":142,"meta":143,"navigation":72,"path":147,"seo":148,"sitemap":149,"stem":150,"tags":151,"updatedAt":152,"__hash__":153},"blog\u002Fblog\u002Fexport-variables-from-css-modules-into-sfcs.md","Export Variables from CSS Modules into SFCs",{"type":7,"value":8,"toc":138},"minimark",[9,13,16,128,135],[10,11,12],"p",{},"One of the things that's always been tricky about striking the right balance between leveraging JavaScript and CSS together is the fact that often JavaScript can dictate how CSS works, but it's rarely the other way around.",[10,14,15],{},"Well I'm here to drop some knowledge because with CSS Modules you can totally do this!",[17,18,23],"pre",{"className":19,"code":20,"language":21,"meta":22,"style":22},"language-vue shiki shiki-themes github-dark-high-contrast","\u003Ctemplate>\n  \u003Cp>Grid Padding: {{ $style.gridPadding }}\u003C\u002Fp>\n\u003C\u002Ftemplate>\n\n\u003Cstyle module>\n:export {\n  gridPadding: 1.5rem;\n}\n\u003C\u002Fstyle>\n","vue","",[24,25,26,42,57,67,74,88,94,113,119],"code",{"__ignoreMap":22},[27,28,31,35,39],"span",{"class":29,"line":30},"line",1,[27,32,34],{"class":33},"sMAXC","\u003C",[27,36,38],{"class":37},"sKpQp","template",[27,40,41],{"class":33},">\n",[27,43,45,48,50,53,55],{"class":29,"line":44},2,[27,46,47],{"class":33},"  \u003C",[27,49,10],{"class":37},[27,51,52],{"class":33},">Grid Padding: {{ $style.gridPadding }}\u003C\u002F",[27,54,10],{"class":37},[27,56,41],{"class":33},[27,58,60,63,65],{"class":29,"line":59},3,[27,61,62],{"class":33},"\u003C\u002F",[27,64,38],{"class":37},[27,66,41],{"class":33},[27,68,70],{"class":29,"line":69},4,[27,71,73],{"emptyLinePlaceholder":72},true,"\n",[27,75,77,79,82,86],{"class":29,"line":76},5,[27,78,34],{"class":33},[27,80,81],{"class":37},"style",[27,83,85],{"class":84},"sCcAr"," module",[27,87,41],{"class":33},[27,89,91],{"class":29,"line":90},6,[27,92,93],{"class":33},":export {\n",[27,95,97,100,103,106,110],{"class":29,"line":96},7,[27,98,99],{"class":84},"  gridPadding",[27,101,102],{"class":33},": ",[27,104,105],{"class":84},"1.5",[27,107,109],{"class":108},"sWyjQ","rem",[27,111,112],{"class":33},";\n",[27,114,116],{"class":29,"line":115},8,[27,117,118],{"class":33},"}\n",[27,120,122,124,126],{"class":29,"line":121},9,[27,123,62],{"class":33},[27,125,81],{"class":37},[27,127,41],{"class":33},[10,129,130,131,134],{},"And just like that, you now have access to any property you defined within the ",[24,132,133],{},":export"," selector. Imagine the possibilities!",[81,136,137],{},"html pre.shiki code .sMAXC, html code.shiki .sMAXC{--shiki-default:#F0F3F6}html pre.shiki code .sKpQp, html code.shiki .sKpQp{--shiki-default:#72F088}html pre.shiki code .sCcAr, html code.shiki .sCcAr{--shiki-default:#91CBFF}html pre.shiki code .sWyjQ, html code.shiki .sWyjQ{--shiki-default:#FF9492}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":22,"searchDepth":44,"depth":44,"links":139},[],"2020-12-20T23:13:00-05:00","Did you know you could export variables from CSS modules into the rest of your component?!","md",{"stage":144,"planted":140,"tended":140,"topics":145},"evergreen",[21,146],"css","\u002Fblog\u002Fexport-variables-from-css-modules-into-sfcs",{"title":5,"description":141},{"loc":147,"lastmod":140},"blog\u002Fexport-variables-from-css-modules-into-sfcs",[21,146],null,"B3x6xsbAgkrrpU5NgPw-5vATuBlKDWQwauu_GYT_yAg",{"newer":155,"older":161,"related":167},{"title":156,"path":157,"tags":158,"date":160},"2020 Retrospective","\u002Fblog\u002F2020-retrospective",[159],"retrospectives","2021-01-01T21:44:42-05:00",{"title":162,"path":163,"tags":164,"date":166},"Tutorial: Vue 3 Apps with DevTools","\u002Fblog\u002Ftutorial-vue-3-apps-with-devtools",[21,165],"development","2020-10-21T19:24:37-04:00",[168,174,180],{"title":169,"path":170,"tags":171,"date":173},"My Favorite Underrated Vue 3 Feature","\u002Fblog\u002Fmy-favorite-underrated-vue-3-feature",[21,146,172],"javascript","2023-08-08T20:32:39-04:00",{"title":175,"path":176,"tags":177,"date":179},"VueConfUS 2026 Recap","\u002Fblog\u002Fvueconfus-2026-recap",[178,21],"events","2026-06-24T02:48:45-04:00",{"title":181,"path":182,"tags":183,"date":184},"Stop forgetting to trigger workflows in Vue","\u002Fblog\u002Fstop-forgetting-to-trigger-workflows-in-vue",[21,165],"2025-12-02T17:06:20-05:00",1794345607668]