@marigold/theme-rui 0.4.0 → 1.0.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/dist/theme.css CHANGED
@@ -1,4 +1,4 @@
1
- @import './mixins.css';
1
+ @import './utils.css';
2
2
 
3
3
  /*
4
4
  TODO: how to do normalization so we doesn't break everything?
package/dist/utils.css ADDED
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Custom Tailwind utilities
3
+ *
4
+ * This file contains reusable utility functions and class shortcuts that
5
+ * encapsulate common design decisions across the theme. These include
6
+ * standardized styling for interactive states like keyboard focus, disabled
7
+ * components, and other consistent UI patterns.
8
+ */
9
+
10
+ /*
11
+ * Applies a consistent visual style for keyboard focus states across components.
12
+ * This utility sets a colored focus ring and border based on the given theme color,
13
+ * while removing the default outline.
14
+ *
15
+ * Use this as a default for all components (that don't have their own border).
16
+ */
17
+ @utility util-focus-* {
18
+ border-color: --value(--color- *);
19
+ outline-style: none;
20
+
21
+ --tw-ring-color: --alpha(--value(--color- *) / 50%);
22
+ --tw-ring-shadow: 0 0 0 3px var(--tw-ring-color, currentcolor);
23
+ box-shadow:
24
+ var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
25
+ var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
26
+ }
27
+
28
+ /*
29
+ * Applies a consistent visual style for keyboard focus states across components.
30
+ * This utility sets a colored focus ring based on the given theme color,
31
+ * while removing the default outline.
32
+ *
33
+ * Use this when the component has its own border and you need to keep it.
34
+ */
35
+ @utility util-focus-borderless-* {
36
+ outline-style: none;
37
+
38
+ --tw-ring-color: --alpha(--value(--color- *) / 50%);
39
+ --tw-ring-shadow: 0 0 0 3px var(--tw-ring-color, currentcolor);
40
+ box-shadow:
41
+ var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
42
+ var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
43
+ }
44
+
45
+ /*
46
+ * Defines a consistent visual and behavioral style for disabled UI elements.
47
+ */
48
+ @utility util-disabled {
49
+ background-color: var(--color-disabled);
50
+ color: var(--color-disabled-foreground);
51
+
52
+ cursor: not-allowed;
53
+
54
+ --tw-border-style: none;
55
+ border-style: none;
56
+
57
+ --tw-shadow: 0 0 #0000;
58
+ box-shadow:
59
+ var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
60
+ var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
61
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marigold/theme-rui",
3
- "version": "0.4.0",
3
+ "version": "1.0.0",
4
4
  "description": "Marigold RUI Theme",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -43,21 +43,21 @@
43
43
  "directory": "themes/theme-rui"
44
44
  },
45
45
  "devDependencies": {
46
- "@tailwindcss/postcss": "4.0.17",
46
+ "@tailwindcss/postcss": "4.1.3",
47
47
  "cssnano": "7.0.6",
48
48
  "postcss-cli": "11.0.1",
49
- "tailwindcss": "4.0.17",
50
- "tsup": "8.3.6",
49
+ "tailwindcss": "4.1.3",
50
+ "tsup": "8.4.0",
51
51
  "@marigold/tsconfig": "0.4.0"
52
52
  },
53
53
  "dependencies": {
54
54
  "tailwindcss-animate": "1.0.7",
55
55
  "tailwindcss-react-aria-components": "2.0.0",
56
- "@marigold/components": "11.3.0",
57
- "@marigold/system": "11.3.0",
56
+ "@marigold/components": "11.4.1",
57
+ "@marigold/system": "11.4.1",
58
58
  "@marigold/theme-plugins": "1.0.1"
59
59
  },
60
60
  "scripts": {
61
- "build": "NODE_ENV=production tsup && postcss -o dist/styles.css src/styles.css && cp src/theme.css src/global.css src/mixins.css dist/"
61
+ "build": "NODE_ENV=production tsup && postcss -o dist/styles.css src/styles.css && cp src/theme.css src/global.css src/utils.css dist/"
62
62
  }
63
63
  }
package/dist/mixins.css DELETED
@@ -1,54 +0,0 @@
1
- /*
2
- File: tailwind-components.css
3
-
4
- Description
5
- -----------
6
- This file defines custom Tailwind CSS component classes by bundling commonly used utility classes
7
- with the @apply directive. The goal is to reduce duplication, enhance maintainability, and ensure
8
- a consistent styling pattern across various components.
9
-
10
- Usage
11
- -----
12
- Import this file into your main stylesheet or reference it in your Tailwind CSS configuration.
13
-
14
- Best Practices
15
- --------------
16
- - Encapsulate frequently used utility combinations into custom classes for better reusability.
17
- - Update the definitions here to maintain consistency in our design system across all components.
18
- - Keep custom classes focused on specific styling concerns to preserve clarity.
19
- */
20
-
21
- @layer utilities {
22
- /*==============*/
23
- /* Focus */
24
- /*==============*/
25
- .mixin-ring-focus-visible {
26
- @apply focus-visible:border-ring focus-visible:ring-ring/50 outline-none focus-visible:ring-[3px];
27
- }
28
-
29
- .mixin-ring-has-focus-visible {
30
- @apply has-focus-visible:border-border has-focus-visible:ring-ring/50 has-focus-visible:ring-[3px];
31
- }
32
-
33
- /* TODO: rename the groups to something common? e.g. "control" or something */
34
- .mixin-ring-focus-visible-checkbox {
35
- @apply group-focus-visible/checkbox:ring-ring/50 group-focus-visible/checkbox:ring-[3px];
36
- }
37
- .mixin-ring-focus-visible-radio {
38
- @apply group-focus-visible/radio:ring-ring/50 group-focus-visible/radio:ring-[3px];
39
- }
40
- .mixin-ring-focus-visible-switch {
41
- @apply group-focus-visible/switch:ring-ring/50 group-focus-visible/switch:ring-[3px];
42
- }
43
-
44
- .mixin-ring-focus-visible-borderless {
45
- @apply focus-visible:ring-ring/50 outline-none focus-visible:ring-[3px];
46
- }
47
-
48
- /*==============*/
49
- /* Disabled */
50
- /*==============*/
51
- .mixin-disabled {
52
- @apply disabled:bg-disabled disabled:text-disabled-foreground disabled:cursor-not-allowed disabled:border-none disabled:shadow-none;
53
- }
54
- }