fix typography: include plugin on prod build.

This commit is contained in:
fiatjaf
2023-10-29 08:15:16 -03:00
parent 32f25bb2d4
commit d50cd65165
3 changed files with 15 additions and 5 deletions

View File

@@ -68,7 +68,13 @@ func main() {
log.Fatal().Err(err).Msg("failed to load tailwind.config.js") log.Fatal().Err(err).Msg("failed to load tailwind.config.js")
return return
} }
config := strings.Replace(string(configb), "module.exports", "tailwind.config", 1) config := strings.Replace(
strings.Replace(
string(configb),
"plugins: [require('@tailwindcss/typography')]", "", 1,
),
"module.exports", "tailwind.config", 1,
)
styleb, err := os.ReadFile("tailwind.css") styleb, err := os.ReadFile("tailwind.css")
if err != nil { if err != nil {

View File

@@ -6,5 +6,8 @@
}, },
"scripts": { "scripts": {
"postinstall": "tailwind -i tailwind.css -o static/tailwind-bundle.min.css --minify" "postinstall": "tailwind -i tailwind.css -o static/tailwind-bundle.min.css --minify"
},
"dependencies": {
"@tailwindcss/typography": "^0.5.10"
} }
} }

View File

@@ -9,7 +9,7 @@ module.exports = {
fontSize: { fontSize: {
xs: '0.7rem', xs: '0.7rem',
sm: '0.8rem', sm: '0.8rem',
'2xl': ['1.5rem', '1.1rem'], '2xl': ['1.5rem', '1.1rem']
}, },
colors: { colors: {
lavender: '#fdf0f5', lavender: '#fdf0f5',
@@ -18,10 +18,10 @@ module.exports = {
garnet: '#42091e' garnet: '#42091e'
}, },
borderWidth: { borderWidth: {
'05rem': '0.5rem', // You can define custom border widths in rem units '05rem': '0.5rem' // you can define custom border widths in rem units
}, },
gap: { gap: {
'48vw': '4.8vw', '48vw': '4.8vw'
}, },
typography: ({theme}) => ({ typography: ({theme}) => ({
/* for markdown html content */ /* for markdown html content */
@@ -35,5 +35,6 @@ module.exports = {
} }
}) })
} }
} },
plugins: [require('@tailwindcss/typography')]
} }