@obosbbl/grunnmuren-tailwind 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,14 +26,17 @@ module.exports = {
26
26
 
27
27
  // Usage with options
28
28
  module.exports = {
29
- presets: [require('@obosbbl/grunnmuren-tailwind')({ useLegacyFont: true }),
29
+ presets: [require('@obosbbl/grunnmuren-tailwind')({ useLegacyFont: true, fontBasePath: '/mypath/myfonts' }),
30
30
  // content: [ ... ]
31
31
  };
32
32
  ```
33
33
 
34
34
  ### Fonts
35
35
 
36
- The preset includes font declarations. You'll have to setup your app so it serves the necessary [font files](../react/public/fonts/) at the path `/fonts/`. See the [preset implementation](./tailwind-base.cjs).
36
+ The preset includes font declarations.
37
+ You'll have to setup your app so it serves the necessary [font files](../react/public/fonts/).
38
+ By default the fonts should be under `/fonts/` but you can override this with the config option `fontBasePath`.
39
+ See the [preset implementation](./tailwind-base.cjs).
37
40
 
38
41
  ## Options
39
42
 
@@ -42,3 +45,4 @@ The preset supports the following options:
42
45
  | Name | Default value | Description |
43
46
  | ------------- | ------------- | -------------------------------------------- |
44
47
  | useLegacyFont | `false` | Whether to use the fonts from the old design |
48
+ | fontBasePath | `/fonts` | Path to where the fonts are hosted |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-tailwind",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Grunnmuren Tailwind preset",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
package/tailwind-base.cjs CHANGED
@@ -5,22 +5,22 @@ const gorditaFonts = [
5
5
  {
6
6
  fontWeight: 400,
7
7
  fontStyle: 'normal',
8
- url: '/fonts/gorditaregular-webfont.woff2',
8
+ url: '/gorditaregular-webfont.woff2',
9
9
  },
10
10
  {
11
11
  fontWeight: 400,
12
12
  fontStyle: 'italic',
13
- url: '/fonts/gorditaregularitalic-webfont.woff2',
13
+ url: '/gorditaregularitalic-webfont.woff2',
14
14
  },
15
15
  {
16
16
  fontWeight: 500,
17
17
  fontStyle: 'normal',
18
- url: '/fonts/gorditamedium-webfont.woff2',
18
+ url: '/gorditamedium-webfont.woff2',
19
19
  },
20
20
  {
21
21
  fontWeight: 700,
22
22
  fontStyle: 'normal',
23
- url: '/fonts/gorditabold-webfont.woff2',
23
+ url: '/gorditabold-webfont.woff2',
24
24
  },
25
25
  ];
26
26
 
@@ -28,22 +28,22 @@ const obosFonts = [
28
28
  {
29
29
  fontWeight: 400,
30
30
  fontStyle: 'normal',
31
- url: '/fonts/OBOSText-Regular.woff2',
31
+ url: '/OBOSText-Regular.woff2',
32
32
  },
33
33
  {
34
34
  fontWeight: 400,
35
35
  fontStyle: 'italic',
36
- url: '/fonts/OBOSText-Italic.woff2',
36
+ url: '/OBOSText-Italic.woff2',
37
37
  },
38
38
  {
39
39
  fontWeight: 500,
40
40
  fontStyle: 'normal',
41
- url: '/fonts/OBOSText-Medium.woff2',
41
+ url: '/OBOSText-Medium.woff2',
42
42
  },
43
43
  {
44
44
  fontWeight: 700,
45
45
  fontStyle: 'normal',
46
- url: '/fonts/OBOSText-Bold.woff2',
46
+ url: '/OBOSText-Bold.woff2',
47
47
  },
48
48
  ];
49
49
 
@@ -157,7 +157,10 @@ const snackbar = plugin(function ({ addComponents, theme }) {
157
157
  });
158
158
  });
159
159
 
160
- module.exports = (opts = { useLegacyFont: false }) => {
160
+ const defaultOpts = { useLegacyFont: false, fontBasePath: '/fonts' };
161
+
162
+ module.exports = (userOptions) => {
163
+ const opts = userOptions ? { ...defaultOpts, ...userOptions } : defaultOpts;
161
164
  let fontFamily = 'OBOSFont';
162
165
  let fonts = obosFonts;
163
166
  if (opts.useLegacyFont) {
@@ -189,6 +192,10 @@ module.exports = (opts = { useLegacyFont: false }) => {
189
192
  '@apply underline': {},
190
193
  },
191
194
  '::selection': { '@apply bg-green-light text-black': {} },
195
+ // Remove the disclosure triangle in Safari if apply the `list-none` utility to the summary element
196
+ 'summary.list-none::-webkit-details-marker': {
197
+ display: 'none',
198
+ },
192
199
  });
193
200
  addComponents({
194
201
  '.container': {
@@ -245,7 +252,7 @@ module.exports = (opts = { useLegacyFont: false }) => {
245
252
  fontFamily,
246
253
  fontWeight: font.fontWeight,
247
254
  fontStyle: font.fontStyle,
248
- src: `url('${font.url}') format('woff2')`,
255
+ src: `url('${opts.fontBasePath}${font.url}') format('woff2')`,
249
256
  fontDisplay: 'swap',
250
257
  },
251
258
  })),
@@ -339,6 +346,8 @@ module.exports = (opts = { useLegacyFont: false }) => {
339
346
  css: {
340
347
  '--tw-prose-headings': theme('colors.black'),
341
348
  '--tw-prose-lead': theme('colors.black'),
349
+ // TODO: Increase bullet size. See design sketches
350
+ '--tw-prose-bullets': theme('colors.green.DEFAULT'),
342
351
  color: theme('colors.black'),
343
352
  maxWidth: theme('maxWidth.prose'),
344
353
  a: {
@@ -356,6 +365,10 @@ module.exports = (opts = { useLegacyFont: false }) => {
356
365
  h4: {
357
366
  fontWeight: 'bold',
358
367
  },
368
+ li: {
369
+ marginTop: '1.5em',
370
+ marginBottom: '1.5em',
371
+ },
359
372
  '[class~="lead"]': {
360
373
  fontWeight: 500,
361
374
  },