@area8975/ui 0.1.1-dev.12 → 0.1.1-dev.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@area8975/ui",
3
- "version": "0.1.1-dev.12",
3
+ "version": "0.1.1-dev.15",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.0.0",
6
6
  "@angular/core": "^22.0.0",
package/theme.css CHANGED
@@ -13,6 +13,9 @@
13
13
  /* Defaults hover styles on all devices */
14
14
  @custom-variant hover (&:hover);
15
15
 
16
+ /* dark: follows a .dark class on <html> rather than the media query, so an app can offer System, Light and Dark */
17
+ @custom-variant dark (&:where(.dark, .dark *));
18
+
16
19
 
17
20
  @font-face {
18
21
  font-family: "Inter";
@@ -111,3 +114,66 @@
111
114
  --color-danger-900: var(--color-red-900);
112
115
  --color-danger-950: var(--color-red-950);
113
116
  }
117
+
118
+
119
+ /* Paints the page, otherwise the browser's white shows through whatever --background is */
120
+ @layer base {
121
+ body {
122
+ background-color: var(--background);
123
+ color: var(--foreground);
124
+ }
125
+ }
126
+
127
+ /*
128
+ * Softer light theme. The page is a light grey so white cards and the sidebar
129
+ * stand off it, edged with a slightly stronger line. Dark mode keeps Preline's.
130
+ */
131
+ :root:not(.dark) {
132
+ --background: oklch(0.948 0.005 264);
133
+ --sidebar: var(--card);
134
+ --sidebar-line: oklch(0.9 0.006 264);
135
+ --card-line: oklch(0.9 0.006 264);
136
+ }
137
+
138
+ /* Dark to match, a deeper page with the cards and sidebar raised off it */
139
+ .dark {
140
+ --background: var(--color-neutral-900);
141
+ --sidebar: var(--card);
142
+ --sidebar-line: var(--card-line);
143
+
144
+ /* menus sit on cards, Preline's item hover is the card's own colour so it never showed */
145
+ --dropdown-item-hover: var(--color-neutral-700);
146
+ --dropdown-item-focus: var(--color-neutral-700);
147
+ --dropdown-item-active: var(--color-neutral-700);
148
+ }
149
+
150
+ /*
151
+ * Dark tints. Soft fills, borders and focus rings use the 50 to 200 shades and
152
+ * soft text the 800 one, so in dark those become see-through tints of the
153
+ * colour and a light text shade. Solid colours stay as they are.
154
+ */
155
+ .dark {
156
+ --color-primary-50: color-mix(in oklab, var(--color-blue-500) 12%, transparent);
157
+ --color-primary-100: color-mix(in oklab, var(--color-blue-500) 20%, transparent);
158
+ --color-primary-200: color-mix(in oklab, var(--color-blue-500) 30%, transparent);
159
+ --color-primary-800: var(--color-blue-300);
160
+
161
+ --color-success-50: color-mix(in oklab, var(--color-teal-500) 12%, transparent);
162
+ --color-success-100: color-mix(in oklab, var(--color-teal-500) 20%, transparent);
163
+ --color-success-200: color-mix(in oklab, var(--color-teal-500) 30%, transparent);
164
+ --color-success-800: var(--color-teal-300);
165
+
166
+ --color-warning-50: color-mix(in oklab, var(--color-yellow-500) 12%, transparent);
167
+ --color-warning-100: color-mix(in oklab, var(--color-yellow-500) 20%, transparent);
168
+ --color-warning-200: color-mix(in oklab, var(--color-yellow-500) 30%, transparent);
169
+ --color-warning-800: var(--color-yellow-300);
170
+
171
+ --color-danger-50: color-mix(in oklab, var(--color-red-500) 12%, transparent);
172
+ --color-danger-100: color-mix(in oklab, var(--color-red-500) 20%, transparent);
173
+ --color-danger-200: color-mix(in oklab, var(--color-red-500) 30%, transparent);
174
+ --color-danger-800: var(--color-red-300);
175
+
176
+ --color-secondary-50: color-mix(in oklab, var(--color-gray-500) 12%, transparent);
177
+ --color-secondary-100: color-mix(in oklab, var(--color-gray-500) 20%, transparent);
178
+ --color-secondary-200: color-mix(in oklab, var(--color-gray-500) 30%, transparent);
179
+ }