Files
medusa-store/www/apps/ui/tailwind.config.js
Shahed Nasser d1a1135328 docs: migrate UI docs (#13245)
* docs: create a new UI docs project (#13233)

* docs: create a new UI docs project

* fix installation errors

* docs: migrate UI docs content to new project (#13241)

* Fix content

* added examples for some components

* finish adding examples

* lint fix

* fix build errors

* delete empty files

* path fixes + refactor

* fix build error
2025-08-20 11:42:25 +03:00

49 lines
1.4 KiB
JavaScript

import path from "path"
import coreConfig from "tailwind"
// Get two levels up from require.resolve("@medusajs/ui")
const root = path.join(require.resolve("@medusajs/ui"), "../..")
const uiPath = path.join(root, "**/*.{js,ts,jsx,tsx,mdx}")
// filter out unwanted config from the core theme
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { spacing, ...coreTheme } = coreConfig.theme || {}
// filter out unwanted config from extended theme
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { borderRadius, ...extendedTheme } = coreConfig.theme?.extend || {}
// remove core spacing except those having "docs" prefix
const modifiedSpacing = {}
Object.entries(coreConfig.theme.spacing)
.filter(([key]) => key.startsWith("docs_"))
.map(([key, value]) => {
modifiedSpacing[key] = value
})
// remove core border radius except those having "docs" prefix
const modifiedRadius = {}
Object.entries(coreConfig.theme.extend.borderRadius)
.filter(([key]) => key.startsWith("docs_"))
.map(([key, value]) => {
modifiedRadius[key] = value
})
module.exports = {
...coreConfig,
content: [...coreConfig.content, "./**/*.{js,ts,jsx,tsx,mdx}", uiPath],
theme: {
...coreTheme,
extend: {
...extendedTheme,
container: {
center: true,
screens: {
"2xl": "1400px",
},
},
borderRadius: modifiedRadius,
spacing: modifiedSpacing,
},
},
}