@obosbbl/grunnmuren-tailwind 0.2.1 → 0.3.0

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.1",
3
+ "version": "0.3.0",
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,7 @@ const snackbar = plugin(function ({ addComponents, theme }) {
157
157
  });
158
158
  });
159
159
 
160
- module.exports = (opts = { useLegacyFont: false }) => {
160
+ module.exports = (opts = { useLegacyFont: false, fontBasePath: '/fonts' }) => {
161
161
  let fontFamily = 'OBOSFont';
162
162
  let fonts = obosFonts;
163
163
  if (opts.useLegacyFont) {
@@ -189,6 +189,10 @@ module.exports = (opts = { useLegacyFont: false }) => {
189
189
  '@apply underline': {},
190
190
  },
191
191
  '::selection': { '@apply bg-green-light text-black': {} },
192
+ // Remove the disclosure triangle in Safari if apply the `list-none` utility to the summary element
193
+ 'summary.list-none::-webkit-details-marker': {
194
+ display: 'none',
195
+ },
192
196
  });
193
197
  addComponents({
194
198
  '.container': {
@@ -245,7 +249,7 @@ module.exports = (opts = { useLegacyFont: false }) => {
245
249
  fontFamily,
246
250
  fontWeight: font.fontWeight,
247
251
  fontStyle: font.fontStyle,
248
- src: `url('${font.url}') format('woff2')`,
252
+ src: `url('${opts.fontBasePath}${font.url}') format('woff2')`,
249
253
  fontDisplay: 'swap',
250
254
  },
251
255
  })),