Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
TailwindCSS - Nuxt typography connector (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
d0rich authored May 7, 2023
1 parent d70d567 commit 6432e64
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@d0rich/nuxt-design-system",
"version": "0.7.3",
"version": "0.7.4",
"main": "./nuxt.config.ts",
"description": "🖼️ Design system for d0rich's projects based on Nuxt 3 and Tailwind CSS",
"keywords": [
Expand Down
14 changes: 14 additions & 0 deletions plugins/tailwind/nuxt-typography.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/** @type {import('tailwindcss/plugin')} */
const plugin = require('tailwindcss/plugin')

module.exports = plugin(function ({ addUtilities, theme }) {
addUtilities({
'.nuxt-typography-connector': {
'--typography-font-sans': theme('fontFamily.sans'),
'--typography-font-serif': theme('fontFamily.serif'),
'--typography-font-mono': theme('fontFamily.mono'),
'--typography-font-dialog': theme('fontFamily.dialog')
}
})
})
2 changes: 2 additions & 0 deletions plugins/tailwind/shadows.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/** @type {import('tailwindcss/plugin')} */
const plugin = require('tailwindcss/plugin')
/** @type {import('tailwindcss/colors')} */
const colors = require('tailwindcss/colors')

const X_OFFSET_VAR = '--tw-ss-x-offset'
Expand Down
3 changes: 2 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
},
plugins: [
require('@tailwindcss/typography'),
require('./plugins/tailwind/shadows')
require('./plugins/tailwind/shadows'),
require('./plugins/tailwind/nuxt-typography')
]
}

0 comments on commit 6432e64

Please sign in to comment.