@tamagui/themes 1.89.29 → 1.89.30

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/src/v3-themes.ts CHANGED
@@ -238,17 +238,10 @@ export const getTemplates = (scheme: 'dark' | 'light') => {
238
238
 
239
239
  // our palettes have 4 things padding each end until you get to bg/color:
240
240
  // [accentBg, transparent1, transparent2, transparent3, transparent4, background, ...]
241
- const bgIndex = 4
242
-
243
- // light themes will start with a slightly stronger bg, and then lighten on hover
244
- // whereas dark themes start with a less strong bg, but lighten on hover as well
245
- const bgBaseOffset = 1
246
-
241
+ const bgIndex = 5
247
242
  const lighten = isLight ? -1 : 1
248
243
  const darken = -lighten
249
-
250
- const background = bgIndex + bgBaseOffset
251
- const borderColor = background + 3
244
+ const borderColor = bgIndex + 3
252
245
 
253
246
  // templates use the palette and specify index
254
247
  // negative goes backwards from end so -1 is the last item
@@ -260,41 +253,41 @@ export const getTemplates = (scheme: 'dark' | 'light') => {
260
253
  background025: 2,
261
254
  background05: 3,
262
255
  background075: 4,
263
- color1: bgIndex + 1,
264
- color2: bgIndex + 2,
265
- color3: bgIndex + 3,
266
- color4: bgIndex + 4,
267
- color5: bgIndex + 5,
268
- color6: bgIndex + 6,
269
- color7: bgIndex + 7,
270
- color8: bgIndex + 8,
271
- color9: bgIndex + 9,
272
- color10: bgIndex + 10,
273
- color11: bgIndex + 11,
274
- color12: bgIndex + 12,
275
- color0: -0,
276
- color025: -1,
277
- color05: -2,
278
- color075: -3,
256
+ color1: bgIndex,
257
+ color2: bgIndex + 1,
258
+ color3: bgIndex + 2,
259
+ color4: bgIndex + 3,
260
+ color5: bgIndex + 4,
261
+ color6: bgIndex + 5,
262
+ color7: bgIndex + 6,
263
+ color8: bgIndex + 7,
264
+ color9: bgIndex + 8,
265
+ color10: bgIndex + 9,
266
+ color11: bgIndex + 10,
267
+ color12: bgIndex + 11,
268
+ color0: -1,
269
+ color025: -2,
270
+ color05: -3,
271
+ color075: -4,
279
272
  // the background, color, etc keys here work like generics - they make it so you
280
273
  // can publish components for others to use without mandating a specific color scale
281
274
  // the @tamagui/button Button component looks for `$background`, so you set the
282
275
  // dark_red_Button theme to have a stronger background than the dark_red theme.
283
- background,
284
- backgroundHover: background + lighten, // always lighten on hover no matter the scheme
285
- backgroundPress: background + darken, // always darken on press no matter the theme
286
- backgroundFocus: background + darken,
276
+ background: bgIndex,
277
+ backgroundHover: bgIndex + lighten, // always lighten on hover no matter the scheme
278
+ backgroundPress: bgIndex + darken, // always darken on press no matter the theme
279
+ backgroundFocus: bgIndex + darken,
287
280
  borderColor,
288
281
  borderColorHover: borderColor + lighten,
289
282
  borderColorPress: borderColor + darken,
290
283
  borderColorFocus: borderColor,
291
- color: -bgIndex - 1,
292
- colorHover: -bgIndex - 2,
293
- colorPress: -bgIndex - 1,
294
- colorFocus: -bgIndex - 2,
295
- colorTransparent: -0,
296
- placeholderColor: -bgIndex - 4,
297
- outlineColor: -1,
284
+ color: -bgIndex,
285
+ colorHover: -bgIndex - 1,
286
+ colorPress: -bgIndex,
287
+ colorFocus: -bgIndex - 1,
288
+ colorTransparent: -1,
289
+ placeholderColor: -bgIndex - 3,
290
+ outlineColor: -2,
298
291
  }
299
292
 
300
293
  const surface1 = {
@@ -1,4 +1,6 @@
1
1
  type Theme = {
2
+ accentBackground: string;
3
+ accentColor: string;
2
4
  background0: string;
3
5
  background025: string;
4
6
  background05: string;
@@ -25,8 +27,8 @@ type Theme = {
25
27
  backgroundFocus: string;
26
28
  borderColor: string;
27
29
  borderColorHover: string;
28
- borderColorFocus: string;
29
30
  borderColorPress: string;
31
+ borderColorFocus: string;
30
32
  color: string;
31
33
  colorHover: string;
32
34
  colorPress: string;