on master help sign in
tailwind.config: pass markdown content thru markdoc for tailwind classes
2be46d2Matilde Park
tailwind.config.js+17−5
@@ -1,8 +1,20 @@
1+const markdoc = require("@markdoc/markdoc");
2+
1module.exports = {
3module.exports = {
2 presets: [require("foundation-design-system/tailwind.config")],
4 presets: [require("foundation-design-system/tailwind.config")],
3− content: [
5+ content: {
6+ files: [
4− "./node_modules/foundation-design-system/**/*.js",
7+ "./node_modules/foundation-design-system/**/*.js",
5− "./pages/**/*.{js,ts,jsx,tsx}",
8+ "./pages/**/*.{js,ts,jsx,tsx}",
6− "./components/**/*.{js,ts,jsx,tsx}",
9+ "./components/**/*.{js,ts,jsx,tsx}",
10+ "./content/**/*.md",
7− ],
11+ ],
12+ transform: {
13+ md: (content) => {
14+ const parsed = markdoc.parse(content);
15+ const transform = markdoc.transform(parsed);
16+ return markdoc.renderers.html(transform);
17+ },
18+ },
19+ },
8};
20};