@dargmuesli/nuxt-vio 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,47 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ a:focus {
7
+ @apply outline-none ring;
8
+ }
9
+
10
+ button:focus {
11
+ @apply outline-none ring;
12
+ }
13
+
14
+ thead {
15
+ @apply sticky top-0 z-10 vio-bg-darken;
16
+ }
17
+
18
+ tbody {
19
+ @apply divide-y vio-divide-darken;
20
+ }
21
+ }
22
+
23
+ @layer utilities {
24
+ .vio-prose {
25
+ @apply m-auto prose prose-sm sm:prose-base lg:prose-lg xl:prose-xl; /* 2xl:prose-2xl */
26
+ }
27
+
28
+ .vio-prose-scheme {
29
+ @apply vio-prose dark:prose-invert;
30
+ }
31
+
32
+ .vio-prose-fullwidth {
33
+ @apply vio-prose max-w-full sm:max-w-full md:max-w-full xl:max-w-full 2xl:max-w-full;
34
+ }
35
+
36
+ .vio-divide-darken {
37
+ @apply divide-background-brighten dark:divide-background-darken;
38
+ }
39
+
40
+ .vio-bg-darken {
41
+ @apply bg-background-brighten dark:bg-background-darken;
42
+ }
43
+
44
+ .vio-border-darken {
45
+ @apply border-background-brighten dark:border-background-darken;
46
+ }
47
+ }
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <h1>{{ statusCode ? `${statusCode} - ` : '' }}{{ statusReason }}</h1>
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { status } from '@http-util/status-i18n'
7
+
8
+ export interface Props {
9
+ statusCode?: number
10
+ }
11
+ const props = withDefaults(defineProps<Props>(), {
12
+ statusCode: undefined,
13
+ })
14
+
15
+ const { locale, t } = useI18n()
16
+
17
+ // computations
18
+ const statusReason = computed(() => {
19
+ return status(props.statusCode, locale) || t('error')
20
+ })
21
+ </script>
22
+
23
+ <i18n lang="yaml">
24
+ de:
25
+ error: Fehler
26
+ en:
27
+ error: Error
28
+ </i18n>
package/nuxt.config.ts CHANGED
@@ -1,5 +1,10 @@
1
+ import { dirname, join } from 'node:path'
2
+ import { fileURLToPath } from 'node:url'
3
+
1
4
  import { LOCALES, SITE_NAME } from './utils/constants'
2
5
 
6
+ const currentDir = dirname(fileURLToPath(import.meta.url))
7
+
3
8
  const BASE_URL =
4
9
  'https://' +
5
10
  (process.env.NUXT_PUBLIC_STACK_DOMAIN ||
@@ -111,4 +116,7 @@ export default defineNuxtConfig({
111
116
  site: {
112
117
  splash: false,
113
118
  },
119
+ tailwindcss: {
120
+ cssPath: join(currentDir, './assets/css/tailwind.css'),
121
+ },
114
122
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,13 +10,15 @@
10
10
  },
11
11
  "packageManager": "pnpm@8.2.0",
12
12
  "files": [
13
+ "assets",
13
14
  "components",
14
15
  "composables",
15
16
  "layouts",
16
17
  "server",
17
18
  "plugins",
18
19
  "utils",
19
- "nuxt.config.ts"
20
+ "nuxt.config.ts",
21
+ "tailwind.config.ts"
20
22
  ],
21
23
  "main": "./nuxt.config.ts",
22
24
  "scripts": {
@@ -25,11 +27,15 @@
25
27
  "generate": "nuxi generate .playground",
26
28
  "preview": "nuxi preview .playground",
27
29
  "prepare": "pnpm husky install && pnpm nuxt prepare .playground",
28
- "lint": "eslint --cache --ext .js,.ts,.vue --ignore-path .gitignore .",
29
- "lint:staged": "pnpm lint-staged"
30
+ "lint": "pnpm lint:js && pnpm lint:ts && pnpm lint:style",
31
+ "lint:js": "eslint --cache --ext .js,.ts,.vue --ignore-path .gitignore .",
32
+ "lint:staged": "pnpm lint-staged",
33
+ "lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore",
34
+ "lint:ts": "pnpm nuxt typecheck"
30
35
  },
31
36
  "dependencies": {
32
37
  "@dargmuesli/nuxt-cookie-control": "5.4.0",
38
+ "@http-util/status-i18n": "0.6.2",
33
39
  "@nuxtjs/html-validator": "1.2.4",
34
40
  "@nuxtjs/i18n": "8.0.0-beta.10",
35
41
  "@nuxtjs/tailwindcss": "6.6.5",
@@ -51,6 +57,11 @@
51
57
  "lint-staged": "13.2.1",
52
58
  "nuxt": "3.4.0",
53
59
  "prettier": "2.8.7",
54
- "typescript": "5.0.4"
60
+ "stylelint": "15.4.0",
61
+ "stylelint-config-recommended-vue": "1.4.0",
62
+ "stylelint-config-standard": "32.0.0",
63
+ "stylelint-no-unsupported-browser-features": "6.1.0",
64
+ "typescript": "5.0.4",
65
+ "vue-tsc": "1.2.0"
55
66
  }
56
67
  }
@@ -0,0 +1,110 @@
1
+ import colors from 'tailwindcss/colors'
2
+ import { PluginAPI } from 'tailwindcss/types/config'
3
+ import typographyPlugin from '@tailwindcss/typography'
4
+
5
+ const heading = (theme: PluginAPI['theme']) =>
6
+ ({
7
+ fontWeight: theme('fontWeight.bold'),
8
+ overflow: 'hidden',
9
+ textOverflow: 'ellipsis',
10
+ } as Record<string, string>)
11
+
12
+ const gray = colors.gray // or slate, zinc, neutral, stone
13
+
14
+ const prose = (theme: PluginAPI['theme']) => ({
15
+ css: {
16
+ a: {
17
+ color: theme('colors.link'),
18
+ textDecoration: 'none',
19
+ },
20
+ h1: {
21
+ lineHeight: theme('lineHeight.snug'),
22
+ },
23
+ h2: {
24
+ lineHeight: theme('lineHeight.snug'),
25
+ },
26
+ h3: {
27
+ lineHeight: theme('lineHeight.snug'),
28
+ },
29
+ h4: {
30
+ lineHeight: theme('lineHeight.snug'),
31
+ },
32
+ h5: {
33
+ lineHeight: theme('lineHeight.snug'),
34
+ },
35
+ h6: {
36
+ lineHeight: theme('lineHeight.snug'),
37
+ },
38
+ },
39
+ })
40
+
41
+ export default {
42
+ darkMode: 'class',
43
+ plugins: [
44
+ typographyPlugin,
45
+ ({ addBase, addComponents, theme }: PluginAPI) => {
46
+ addBase({
47
+ h1: {
48
+ ...heading(theme),
49
+ fontSize: theme('fontSize.4xl'),
50
+ textAlign: 'center',
51
+ },
52
+ h2: {
53
+ ...heading(theme),
54
+ fontSize: theme('fontSize.3xl'),
55
+ },
56
+ h3: {
57
+ ...heading(theme),
58
+ fontSize: theme('fontSize.2xl'),
59
+ },
60
+ h4: {
61
+ ...heading(theme),
62
+ fontSize: theme('fontSize.xl'),
63
+ },
64
+ h5: {
65
+ ...heading(theme),
66
+ fontSize: theme('fontSize.lg'),
67
+ },
68
+ h6: {
69
+ ...heading(theme),
70
+ },
71
+ })
72
+ addComponents({
73
+ '.object-position-custom': {
74
+ objectPosition: '50% 30%',
75
+ },
76
+ })
77
+ },
78
+ ],
79
+ theme: {
80
+ extend: {
81
+ colors: {
82
+ background: {
83
+ bright: colors.white,
84
+ brighten: gray['200'],
85
+ dark: gray['800'],
86
+ darken: gray['700'],
87
+ },
88
+ link: {
89
+ bright: colors.blue['400'],
90
+ dark: colors.blue['600'],
91
+ },
92
+ text: {
93
+ bright: gray['50'],
94
+ dark: gray['900'],
95
+ },
96
+ },
97
+ screens: {
98
+ 12: { raw: '(min-aspect-ratio: 2/1)' },
99
+ },
100
+ typography: (theme: PluginAPI['theme']) => ({
101
+ DEFAULT: prose(theme),
102
+ sm: prose(theme),
103
+ base: prose(theme),
104
+ lg: prose(theme),
105
+ xl: prose(theme),
106
+ '2xl': prose(theme),
107
+ }),
108
+ },
109
+ },
110
+ }