@obosbbl/grunnmuren-tailwind 0.5.1 → 0.6.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tailwind-base.cjs +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-tailwind",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Grunnmuren Tailwind preset",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
package/tailwind-base.cjs CHANGED
@@ -48,6 +48,8 @@ const obosFonts = [
48
48
  ];
49
49
 
50
50
  const button = plugin(function ({ addComponents, theme }) {
51
+ const hoverLoadingBgColor = 'rgba(0, 0, 0, 0.1)';
52
+
51
53
  addComponents({
52
54
  '.button': {
53
55
  // The Tailwind utilities we use for focus styling are kinda hard to "translate", so using the @apply utility here, even though mixing styles are meh...
@@ -82,16 +84,22 @@ const button = plugin(function ({ addComponents, theme }) {
82
84
  left: '-2px',
83
85
  right: '-2px',
84
86
  bottom: '-2px',
85
- borderRadius: '0.75rem',
87
+ borderRadius: 'inherit',
86
88
  },
87
89
  // adds a shade on the button when hovered
88
90
  // ideally this would be solved by just darkening the button background,
89
91
  // but that doesn't really work since some of the button variations have transparent backgrounds
90
92
  '&:hover::after': {
91
- backgroundColor: 'rgba(0, 0, 0, 0.1)',
92
- borderRadius: '0.375rem',
93
+ backgroundColor: hoverLoadingBgColor,
93
94
  transition: `all 200ms ${theme('transitionTimingFunction.DEFAULT')}`,
94
95
  },
96
+ // We use aria-busy to indicate loading state
97
+ '&[aria-busy="true"] > *': {
98
+ visibility: 'hidden',
99
+ },
100
+ '&[aria-busy="true"]::after': {
101
+ backgroundColor: hoverLoadingBgColor,
102
+ },
95
103
  },
96
104
  });
97
105
  });