diff --git a/.changeset/tooltip-content-media-theme.md b/.changeset/tooltip-content-media-theme.md new file mode 100644 index 0000000000000..f9a1ba9f4b50f --- /dev/null +++ b/.changeset/tooltip-content-media-theme.md @@ -0,0 +1,13 @@ +--- +'@astryxdesign/core': patch +'@astryxdesign/cli': patch +'@astryxdesign/theme-butter': patch +'@astryxdesign/theme-gothic': patch +'@astryxdesign/theme-matcha': patch +'@astryxdesign/theme-stone': patch +'@astryxdesign/theme-y2k': patch +--- + +[fix] Tooltip content that uses `Text`, or icons colored by the primary, secondary or accent tokens, as the Tooltip docs show, now reads on the tooltip's inverted surface instead of taking the surface's own color. Its primary, secondary and accent text and icon colors (status and hue colors keep the page's values) come from three new theme tokens, `--color-text-primary-inverted`, `--color-text-secondary-inverted` and `--color-text-accent-inverted`. A theme written in hex or `rgb()` colors that does not set them gets values computed from its own colors when the theme is generated: the surface's text color, and the theme's secondary text and accent at 4.5:1 on `--color-background-inverted`. Where a theme's accent is the tooltip surface's own color, accent text takes the secondary color. The Butter, Gothic, Matcha, Stone and Y2K themes, and their templates that `astryx` copies into a project, set the three roles to named stops of their own palettes. Plain text keeps the tooltip's own text color. Nothing is measured on the page. The token reference that `astryx docs tokens` prints lists the three roles. + +@cixzhang diff --git a/apps/storybook/stories/Tooltip.stories.tsx b/apps/storybook/stories/Tooltip.stories.tsx index 42580e7c3de29..ad16049c38b10 100644 --- a/apps/storybook/stories/Tooltip.stories.tsx +++ b/apps/storybook/stories/Tooltip.stories.tsx @@ -5,6 +5,8 @@ import type {Meta, StoryObj} from '@storybook/react'; import {Tooltip, useTooltip} from '@astryxdesign/core/Tooltip'; import {Button} from '@astryxdesign/core/Button'; import {HStack} from '@astryxdesign/core/Layout'; +import {Text} from '@astryxdesign/core/Text'; +import {Icon} from '@astryxdesign/core/Icon'; const meta: Meta = { title: 'Core/Tooltip', @@ -415,3 +417,54 @@ export const TouchTriggers: Story = { ), }; + +/** + * Rich content on the inverted surface: a plain string, the docs' `Text` + * example, default and secondary `Text`, an icon with text, and bare text + * mixed with an element stay readable in light and dark. + */ +export const RichContent: Story = { + render: () => ( +
+ + +
+ ), +}; diff --git a/docs/architecture/theme-tokens.md b/docs/architecture/theme-tokens.md index b438666a7f3f1..43311f4f7f7d5 100644 --- a/docs/architecture/theme-tokens.md +++ b/docs/architecture/theme-tokens.md @@ -48,7 +48,8 @@ deciding_specs: [spec:AST-006/DEC-1, spec:AST-006/DEC-5] "INV9", "INV10", "INV11", - "INV12" + "INV12", + "INV15" ] } } @@ -236,6 +237,23 @@ then have contradictory winners. `#445564`, has the hue and chroma of `--color-icon-secondary` (`#4E606F`) and is the smallest drop in CIE L* that meets 4.5:1 on every default tint. The lowest pair is `--color-background-gray` over the page body (4.52:1). +- **INV15 — Text on the inverted surface has its own roles.** Tooltip content + colored by the primary, secondary or accent tokens takes three roles for + text on `--color-background-inverted`: + `--color-text-primary-inverted`, `--color-text-secondary-inverted` and + `--color-text-accent-inverted`. A theme that sets them keeps its values. A + theme that sets none of them, but sets a colour they are computed from (its + surface, inverted surface, secondary text or accent), and whose four + source colours are all hex or `rgb()`, gets values computed + when the theme is generated: primary is the theme's surface colour, else + white or black, whichever meets 4.5:1 on the inverted surface; secondary and + accent are the theme's secondary text and accent at the nearest lightness + that meets 4.5:1 on the inverted surface, in light and dark mode. Where the + theme's accent equals the inverted surface, the accent role takes the + secondary role's value. A theme whose record requires named palette stops + sets the three roles to its own stops that meet 4.5:1. Core's + defaults hold the values computed from Core's own colours. Nothing is + measured on the page (`spec:AST-020` FR1; WCAG 2.2 SC 1.4.3). This record does not own: @@ -290,6 +308,9 @@ does not silently change authoring, runtime, compiler, or component contracts. - `packages/core/src/theme/defineTheme.ts` aggregates token types/defaults for validation and authoring; it does not become a second token source. - `packages/core/src/theme/tokens.ts` owns server-safe references and resolution. +- `packages/core/src/theme/tooltipTextDerivation.ts` computes the INV15 roles + a theme leaves unset; `statusRoleDefaults.ts` emits them with the status + roles. - `packages/core/src/theme/localTokens.ts` enforces the boundary between the portable and enrolled local maps; it does not add local names to this vocabulary. @@ -361,6 +382,7 @@ themes and ties fields to badge theming. | INV12 | `packages/core/src/theme/contrast.test.ts` "the stock accent pair meets 4.5:1 in the light/dark theme" (current values: light `#0064E0`, dark `#0171E3`, label `#FFFFFF`) | The stock `--color-on-accent` on `--color-accent` falls below 4.5:1 in light or dark mode | | INV13 | `packages/core/src/theme/contrast.test.ts` resolves `--color-border-control` against the surface and the page body in light and dark for Core's defaults, each theme template and a colour-scale theme | `--color-border-control` falls below 3:1 against the surface or the page body in either mode, for any of them, or a colour-scale theme emits no `--color-border-control` | | INV14 | `packages/core/src/theme/contrast.test.ts` resolves `--color-text-secondary` on each default palette tint over the surface and the page body for Core's defaults; `expandColorScale.test.ts` does the same over the generated surface and body for each representative colour-scale config | `--color-text-secondary` falls below 4.5:1 on a default palette tint over the surface or the page body in either mode | +| INV15 | `packages/core/src/theme/tooltipTextDerivation.test.ts` checks that each derived role meets 4.5:1 on `--color-background-inverted` in light and dark for Core's defaults and for themes with a dark and with a light inverted surface, and that an authored role is kept; `TooltipContentContrast.a11y.chromium.spec.ts` measures tooltip text on the painted surface in every shipped theme | A derived role falls below 4.5:1 on the inverted surface in either mode, or a theme's own value is overridden | | Syntax token regions | `syntax/tokens.test.ts` (selector and every token), `Theme.test.tsx` "marks only a wrapper whose theme sets Core color tokens, for the syntax token rule", and `ThemeNestedSyntaxValues.a11y.chromium.spec.ts` with the CodeTheme "Nested Themes" story, as shipped and lowered | Code in a nested Theme that sets Core color tokens shows the page's syntax colors, or a components-only nested theme, a SyntaxTheme inside a Theme, or a SyntaxTheme around one loses its syntax colors | | Released token compatibility | Type checking plus representative package/source builds | A released CSS variable or typed token name disappears without an explicit migration decision | | Visual defaults | Real Chromium examples in light, dark, status, and high-contrast contexts | A changed default produces unreadable or semantically inconsistent output | diff --git a/docs/specs/components/Tooltip/Tooltip.spec.md b/docs/specs/components/Tooltip/Tooltip.spec.md index 7f4c68597905d..9316dca153809 100644 --- a/docs/specs/components/Tooltip/Tooltip.spec.md +++ b/docs/specs/components/Tooltip/Tooltip.spec.md @@ -253,7 +253,7 @@ Consumer migration instructions belong in consumer docs and release notes. | Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -------------- | ------------------ | | Tooltip surface | Presents the current painted overlay surface, in the theme's inverted surface color (`--color-background-inverted`, the surface Toast paints) with the page surface color (`--color-background-surface`) as its text. The layer is always a scroll container (`overflow-y: auto`), so `position: sticky` and `scroll(nearest)` timelines inside its content resolve against the layer, not the page. | Current source and public docs | Supporting | FR1 | -| Tooltip text | Presents supplied content within the owned surface. | Current source and public docs | Prominent | FR1 | +| Tooltip text | Presents supplied content within the owned surface. Text and icons colored by the primary, secondary or accent tokens take the theme's text roles for the inverted surface (`--color-text-primary-inverted`, `--color-text-secondary-inverted`, `--color-text-accent-inverted`); status, hue and disabled colors keep the page's values, and inherited text keeps the `tooltip` surface's color. | Current source and public docs | Prominent | FR1 | The trigger is caller-owned and outside this anatomy. The current implementation has no arrow element. diff --git a/packages/cli/assets/docs/tree/tokens-color.doc.mjs b/packages/cli/assets/docs/tree/tokens-color.doc.mjs index c2d04f6d445c4..a8f2ba885d672 100644 --- a/packages/cli/assets/docs/tree/tokens-color.doc.mjs +++ b/packages/cli/assets/docs/tree/tokens-color.doc.mjs @@ -203,6 +203,21 @@ export const docs = { "#AA071E", "#E3193B" ], + [ + "--color-text-primary-inverted", + "#FFFFFF", + "#1F1F22" + ], + [ + "--color-text-secondary-inverted", + "#6D8090", + "#71767C" + ], + [ + "--color-text-accent-inverted", + "#2279F6", + "#0171E3" + ], [ "--color-info", "#0064E0", diff --git a/packages/cli/assets/docs/tree/tokens.doc.mjs b/packages/cli/assets/docs/tree/tokens.doc.mjs index b7cfeaba388fb..79e0809d49a94 100644 --- a/packages/cli/assets/docs/tree/tokens.doc.mjs +++ b/packages/cli/assets/docs/tree/tokens.doc.mjs @@ -2,7 +2,7 @@ // AUTO-GENERATED — do not edit manually. // Run: node scripts/generate-token-docs.mjs -// Total: 286 tokens across 15 categories. +// Total: 289 tokens across 15 categories. /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */ export const docs = { diff --git a/packages/cli/assets/templates/themes/butter/butterPaletteRefs.generated.ts b/packages/cli/assets/templates/themes/butter/butterPaletteRefs.generated.ts index e454b9989ceab..203796267512a 100644 --- a/packages/cli/assets/templates/themes/butter/butterPaletteRefs.generated.ts +++ b/packages/cli/assets/templates/themes/butter/butterPaletteRefs.generated.ts @@ -7,15 +7,15 @@ // prettier-ignore export const butterPaletteRefs = { neutral: { - light: {0: '#000000', 15: '#1d1c11', 30: '#4a4732', 40: '#725538', 45: '#605f52', 55: '#79786a', 70: '#adac9e', 75: '#c7c4b2', 80: '#d6d3b8', 85: '#e5e3d4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'}, - dark: {0: '#000000', 5: '#131107', 10: '#261a13', 15: '#2e2117', 20: '#3a2a1f', 30: '#4a4732', 35: '#49473b', 40: '#725538', 45: '#605f52', 60: '#939184', 70: '#adac9e', 80: '#d6d3b8', 85: '#f0edd4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'}, + light: {0: '#000000', 15: '#1d1c11', 30: '#4a4732', 40: '#725538', 45: '#605f52', 55: '#79786a', 60: '#89877a', 70: '#adac9e', 75: '#c7c4b2', 80: '#d6d3b8', 85: '#e5e3d4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'}, + dark: {0: '#000000', 5: '#131107', 10: '#261a13', 15: '#2e2117', 20: '#3a2a1f', 30: '#4a4732', 35: '#49473b', 40: '#725538', 45: '#605f52', 50: '#6c6c5e', 60: '#939184', 70: '#adac9e', 80: '#d6d3b8', 85: '#f0edd4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'}, }, accent: { light: {35: '#194ce8', 40: '#225bff', 55: '#4d82ff'}, dark: {70: '#81a9ff'}, }, yellow: { - dark: {15: '#2c2600', 25: '#443c00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'}, + dark: {15: '#2c2600', 25: '#443c00', 45: '#796b00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'}, light: {25: '#443c00', 30: '#514700', 55: '#958500', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'}, }, purple: { diff --git a/packages/cli/assets/templates/themes/butter/butterTheme.ts b/packages/cli/assets/templates/themes/butter/butterTheme.ts index dea97d3f319fe..12705d38bb54c 100644 --- a/packages/cli/assets/templates/themes/butter/butterTheme.ts +++ b/packages/cli/assets/templates/themes/butter/butterTheme.ts @@ -377,6 +377,10 @@ export const butterTheme = defineTheme({ '--color-background-card': [neutral.light[100], neutral.dark[20]], '--color-background-popover': [neutral.light[100], neutral.dark[20]], '--color-background-inverted': [neutral.light[15], neutral.dark[95]], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1. + '--color-text-primary-inverted': [neutral.light[100], neutral.dark[15]], + '--color-text-secondary-inverted': [neutral.light[60], neutral.dark[50]], + '--color-text-accent-inverted': [accent.light[55], yellow.dark[45]], // Status semantics share the Red, Yellow, and Green families. '--color-error': [red.light[30], red.dark[85]], diff --git a/packages/cli/assets/templates/themes/gothic/gothicTheme.ts b/packages/cli/assets/templates/themes/gothic/gothicTheme.ts index 0e7599d5c5bf3..ab34f3251a244 100644 --- a/packages/cli/assets/templates/themes/gothic/gothicTheme.ts +++ b/packages/cli/assets/templates/themes/gothic/gothicTheme.ts @@ -258,6 +258,11 @@ export const gothicTheme = defineTheme({ '--color-background-card': neutral.dark[15], '--color-background-popover': neutral.dark[20], '--color-background-inverted': neutral.dark[95], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1; + // an accent equal to that surface takes the secondary stop. + '--color-text-primary-inverted': neutral.dark[10], + '--color-text-secondary-inverted': neutral.dark[50], + '--color-text-accent-inverted': neutral.dark[50], '--color-success': green.dark[75], '--color-success-muted': green.dark[75], diff --git a/packages/cli/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts b/packages/cli/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts index 74ed273d6d62a..b1e615e08968f 100644 --- a/packages/cli/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +++ b/packages/cli/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts @@ -7,8 +7,8 @@ // prettier-ignore export const matchaPaletteRefs = { neutral: { - light: {0: '#000000', 20: '#3e481d', 25: '#4c5924', 30: '#5a6b2a', 40: '#707e46', 70: '#b7c29e', 75: '#c0cba9', 85: '#dce3ce', 95: '#f0f0e0', 100: '#ffffff'}, - dark: {0: '#000000', 5: '#12140e', 10: '#1a1c14', 15: '#1e2016', 20: '#3e481d', 30: '#5a6440', 40: '#707e46', 45: '#7a894f', 60: '#94a468', 65: '#92af6a', 70: '#a8bf6a', 75: '#c0cba9', 80: '#cdd8b9', 100: '#ffffff'}, + light: {0: '#000000', 20: '#3e481d', 25: '#4c5924', 30: '#5a6b2a', 40: '#707e46', 65: '#aab58d', 70: '#b7c29e', 75: '#c0cba9', 85: '#dce3ce', 95: '#f0f0e0', 100: '#ffffff'}, + dark: {0: '#000000', 5: '#12140e', 10: '#1a1c14', 15: '#1e2016', 20: '#3e481d', 25: '#4c552e', 30: '#5a6440', 40: '#707e46', 45: '#7a894f', 60: '#94a468', 65: '#92af6a', 70: '#a8bf6a', 75: '#c0cba9', 80: '#cdd8b9', 100: '#ffffff'}, }, teal: { light: {35: '#245546', 50: '#2e6b5a'}, diff --git a/packages/cli/assets/templates/themes/matcha/matchaTheme.ts b/packages/cli/assets/templates/themes/matcha/matchaTheme.ts index f1d6ae88cb099..7ed4c69e5bd5d 100644 --- a/packages/cli/assets/templates/themes/matcha/matchaTheme.ts +++ b/packages/cli/assets/templates/themes/matcha/matchaTheme.ts @@ -136,6 +136,11 @@ export const matchaTheme = defineTheme({ '--color-background-card': [neutral.light[100], neutral.dark[15]], '--color-background-popover': [neutral.light[100], neutral.dark[15]], '--color-background-inverted': [neutral.light[20], neutral.dark[75]], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1; + // an accent equal to that surface takes the secondary stop. + '--color-text-primary-inverted': [neutral.light[100], neutral.dark[10]], + '--color-text-secondary-inverted': [neutral.light[65], neutral.dark[25]], + '--color-text-accent-inverted': [neutral.light[65], neutral.dark[25]], // Status / Sentiment '--color-success': [green.light[50], green.dark[70]], diff --git a/packages/cli/assets/templates/themes/stone/stonePaletteRefs.generated.ts b/packages/cli/assets/templates/themes/stone/stonePaletteRefs.generated.ts index 4b3ef0262dfde..782b188e9a1e7 100644 --- a/packages/cli/assets/templates/themes/stone/stonePaletteRefs.generated.ts +++ b/packages/cli/assets/templates/themes/stone/stonePaletteRefs.generated.ts @@ -27,8 +27,8 @@ export const stonePaletteRefs = { dark: {25: '#274239', 35: '#3a5b50', 70: '#94b3a9', 90: '#d6e7e1'}, }, neutral: { - light: {0: '#000000', 15: '#25252a', 30: '#46464e', 35: '#525259', 40: '#5f5f64', 55: '#848489', 85: '#d4d3dd', 90: '#e2e2e8', 95: '#f0f0f7', 100: '#ffffff'}, - dark: {0: '#000000', 5: '#101018', 10: '#1b1b21', 15: '#25252a', 20: '#302f36', 25: '#3a3a42', 35: '#525159', 40: '#5e5e64', 65: '#9d9ea5', 70: '#ababb3', 80: '#c6c6cf', 90: '#e2e2e8', 95: '#f0f0f9', 100: '#ffffff'}, + light: {0: '#000000', 15: '#25252a', 30: '#46464e', 35: '#525259', 40: '#5f5f64', 55: '#848489', 60: '#919197', 85: '#d4d3dd', 90: '#e2e2e8', 95: '#f0f0f7', 100: '#ffffff'}, + dark: {0: '#000000', 5: '#101018', 10: '#1b1b21', 15: '#25252a', 20: '#302f36', 25: '#3a3a42', 35: '#525159', 40: '#5e5e64', 45: '#6a6a70', 65: '#9d9ea5', 70: '#ababb3', 80: '#c6c6cf', 90: '#e2e2e8', 95: '#f0f0f9', 100: '#ffffff'}, }, orange: { dark: {25: '#4e3522', 35: '#684c34', 70: '#c9a382', 90: '#ffdcbb'}, diff --git a/packages/cli/assets/templates/themes/stone/stoneTheme.ts b/packages/cli/assets/templates/themes/stone/stoneTheme.ts index f64066d66d7ac..a5da81bfe1def 100644 --- a/packages/cli/assets/templates/themes/stone/stoneTheme.ts +++ b/packages/cli/assets/templates/themes/stone/stoneTheme.ts @@ -221,6 +221,11 @@ export const stoneTheme = defineTheme({ '--color-background-card': [neutral.light[100], neutral.dark[15]], '--color-background-popover': [neutral.light[100], neutral.dark[20]], '--color-background-inverted': [neutral.light[15], neutral.dark[95]], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1; + // an accent equal to that surface takes the secondary stop. + '--color-text-primary-inverted': [neutral.light[100], neutral.dark[10]], + '--color-text-secondary-inverted': [neutral.light[60], neutral.dark[45]], + '--color-text-accent-inverted': [neutral.light[60], neutral.dark[45]], // Status / sentiment '--color-success': [green.light[30], green.dark[80]], diff --git a/packages/cli/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts b/packages/cli/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts index 4e9762e04c7fb..bb8f6b6476981 100644 --- a/packages/cli/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +++ b/packages/cli/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts @@ -7,7 +7,7 @@ // prettier-ignore export const y2kPaletteRefs = { neutral: { - light: {15: '#2d241b', 20: '#382e24', 30: '#4f453b', 35: '#5a5146', 40: '#675d52', 75: '#c4b8a9', 80: '#d1c5b8', 85: '#dfd5c9', 90: '#f1e6db', 95: '#fff6ed', 100: '#ffffff'}, + light: {15: '#2d241b', 20: '#382e24', 30: '#4f453b', 35: '#5a5146', 40: '#675d52', 60: '#9a8f82', 75: '#c4b8a9', 80: '#d1c5b8', 85: '#dfd5c9', 90: '#f1e6db', 95: '#fff6ed', 100: '#ffffff'}, dark: {0: '#000000', 5: '#0e0f1a', 10: '#16182b', 15: '#1a1d31', 20: '#1f2238', 25: '#2c3048', 35: '#4a4f6b', 45: '#636889', 70: '#a6acd6', 85: '#d0d4eb', 90: '#dfe2f3', 95: '#edeffc'}, }, purple: { diff --git a/packages/cli/assets/templates/themes/y2k/y2kTheme.ts b/packages/cli/assets/templates/themes/y2k/y2kTheme.ts index a795ea2d10c7b..8c1ad54a66d94 100644 --- a/packages/cli/assets/templates/themes/y2k/y2kTheme.ts +++ b/packages/cli/assets/templates/themes/y2k/y2kTheme.ts @@ -362,6 +362,11 @@ export const y2kTheme = defineTheme({ '--color-background-card': [neutral.light[100], neutral.dark[10]], '--color-background-popover': [neutral.light[100], neutral.dark[20]], '--color-background-inverted': [neutral.light[15], neutral.dark[95]], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1; + // an accent equal to that surface takes the secondary stop. + '--color-text-primary-inverted': [neutral.light[100], neutral.dark[10]], + '--color-text-secondary-inverted': [neutral.light[60], neutral.dark[45]], + '--color-text-accent-inverted': [neutral.light[60], neutral.dark[45]], // Status / sentiment '--color-success': [green.light[80], green.dark[80]], diff --git a/packages/core/src/Tooltip/__tests__/TooltipContentContrast.a11y.chromium.spec.ts b/packages/core/src/Tooltip/__tests__/TooltipContentContrast.a11y.chromium.spec.ts new file mode 100644 index 0000000000000..3b1eef0643e2c --- /dev/null +++ b/packages/core/src/Tooltip/__tests__/TooltipContentContrast.a11y.chromium.spec.ts @@ -0,0 +1,231 @@ +// Copyright (c) Meta Platforms, Inc. and affiliates. +// @pr-a11y scope ^packages/core/src/theme/ ^packages/themes/ + +/** + * @file TooltipContentContrast.a11y.chromium.spec.ts + * @input The built `Core/Tooltip` RichContent story in every shipped theme, + * light and dark: a plain string, the docs' `Text` example, default and + * secondary `Text`, an icon with text, and bare text mixed with an element, + * each in an open tooltip + * @output Chromium proof that text in a tooltip meets WCAG AA (4.5:1) and an + * icon meets 3:1 against the tooltip's painted surface, and that bare text + * keeps the `tooltip` surface's own color + * @position Content colors come from the theme's text roles for the inverted + * surface. + * Only a real engine resolves the theme tokens and the painted surface, so + * the measure runs in a browser. + * + * SYNC: Fixture lives in /apps/storybook/stories/Tooltip.stories.tsx + * (RichContent). + */ + +import {expect, test, type Page} from '@astryxdesign/a11y-spec/playwright'; +import {holdMotionStill} from '@astryxdesign/a11y-spec/chromium'; +import { + DEFAULT_STORYBOOK_DIR, + serveStorybook, + type StaticServer, +} from '@astryxdesign/a11y-spec/storybook'; + +let storybook: StaticServer; +test.beforeAll(async () => { + storybook = await serveStorybook( + process.env.ASTRYX_STORYBOOK_DIR ?? DEFAULT_STORYBOOK_DIR, + ); +}); +test.afterAll(async () => { + await storybook?.close(); +}); + +const STORY = 'core-tooltip--rich-content'; +const SHIPPED_THEMES = [ + 'butter', + 'chocolate', + 'gothic', + 'matcha', + 'neutral', + 'stone', + 'y2k', +]; +const MODES = ['light', 'dark']; + +/** + * Each tooltip's text runs and icons that fall below their minimum: 4.5:1 for + * text, 3:1 for an icon. The measure uses the painted surface behind the + * content and the color each part draws with, opacity included. + */ +async function lowContrastParts(page: Page): Promise { + return page.evaluate(() => { + const canvas = document.createElement('canvas').getContext('2d', { + willReadFrequently: true, + }) as CanvasRenderingContext2D; + type Rgba = [number, number, number, number]; + const rgba = (color: string): Rgba => { + canvas.clearRect(0, 0, 1, 1); + canvas.fillStyle = color; + canvas.fillRect(0, 0, 1, 1); + const [r, g, b, a] = canvas.getImageData(0, 0, 1, 1).data; + return [r, g, b, a / 255]; + }; + const over = (top: Rgba, under: Rgba): Rgba => { + const a = top[3] + under[3] * (1 - top[3]); + const mix = (i: number) => + a === 0 + ? 0 + : (top[i] * top[3] + under[i] * under[3] * (1 - top[3])) / a; + return [mix(0), mix(1), mix(2), a]; + }; + const luminance = ([r, g, b]: Rgba) => { + const linear = (v: number) => { + const c = v / 255; + return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4; + }; + return 0.2126 * linear(r) + 0.7152 * linear(g) + 0.0722 * linear(b); + }; + const ratio = (a: Rgba, b: Rgba) => { + const [high, low] = [luminance(a), luminance(b)].sort((x, y) => y - x); + return (high + 0.05) / (low + 0.05); + }; + const backdropOf = (element: Element): Rgba => { + const chain: Element[] = []; + for ( + let node: Element | null = element; + node; + node = node.parentElement + ) { + chain.unshift(node); + } + let background: Rgba = [255, 255, 255, 1]; + for (const node of chain) { + background = over( + rgba(getComputedStyle(node).backgroundColor), + background, + ); + } + return background; + }; + const drawnColor = (element: Element, color: string, background: Rgba) => { + let opacity = 1; + for ( + let node: Element | null = element; + node; + node = node.parentElement + ) { + opacity *= Number(getComputedStyle(node).opacity); + } + const ink = rgba(color); + return over([ink[0], ink[1], ink[2], ink[3] * opacity], background); + }; + + const failures: string[] = []; + for (const tooltip of document.querySelectorAll('[role="tooltip"]')) { + const walker = document.createTreeWalker(tooltip, NodeFilter.SHOW_TEXT); + for (let node = walker.nextNode(); node; node = walker.nextNode()) { + const text = node.textContent?.trim(); + const element = node.parentElement; + if (!text || element == null) { + continue; + } + const background = backdropOf(element); + const drawn = drawnColor( + element, + getComputedStyle(element).color, + background, + ); + const found = ratio(drawn, background); + if (found < 4.5) { + failures.push(`text "${text}": ${found.toFixed(2)}:1`); + } + } + for (const icon of tooltip.querySelectorAll('svg')) { + const background = backdropOf(icon); + const style = getComputedStyle(icon); + const paint = + style.fill !== 'none' && !style.fill.startsWith('url(') + ? style.fill + : style.stroke !== 'none' + ? style.stroke + : style.color; + const drawn = drawnColor(icon, paint, background); + const found = ratio(drawn, background); + if (found < 3) { + failures.push(`icon: ${found.toFixed(2)}:1`); + } + } + } + return failures; + }); +} + +for (const theme of SHIPPED_THEMES) { + test(`tooltip text reaches 4.5:1 and icons 3:1 in ${theme}, light and dark`, async ({ + page, + }) => { + const failures: string[] = []; + for (const mode of MODES) { + await page.goto( + `${storybook.origin}/iframe.html?id=${STORY}&viewMode=story&globals=astryxTheme:${theme};colorMode:${mode}`, + ); + // Measure at rest, not during the entrance fade. + await holdMotionStill(page); + await expect(page.getByRole('tooltip')).toHaveCount(6); + await expect(page.getByText('Body text')).toBeVisible(); + await page.evaluate(async () => { + await document.fonts.ready; + await new Promise(resolve => + requestAnimationFrame(() => requestAnimationFrame(resolve)), + ); + }); + failures.push( + ...(await lowContrastParts(page)).map(failure => `${mode}: ${failure}`), + ); + } + expect(failures).toEqual([]); + }); +} + +for (const theme of SHIPPED_THEMES) { + test(`bare text keeps the tooltip surface's color in ${theme}, light and dark`, async ({ + page, + }) => { + const mismatches: string[] = []; + for (const mode of MODES) { + await page.goto( + `${storybook.origin}/iframe.html?id=${STORY}&viewMode=story&globals=astryxTheme:${theme};colorMode:${mode}`, + ); + // Measure at rest, not during the entrance fade. + await holdMotionStill(page); + await expect(page.getByRole('tooltip')).toHaveCount(6); + const found = await page.evaluate(() => { + const out: string[] = []; + for (const tooltip of document.querySelectorAll('[role="tooltip"]')) { + const surface = getComputedStyle(tooltip).color; + const walker = document.createTreeWalker( + tooltip, + NodeFilter.SHOW_TEXT, + ); + for (let node = walker.nextNode(); node; node = walker.nextNode()) { + const text = node.textContent?.trim(); + const element = node.parentElement; + // Only text no component colors: a plain string, or bare text and + // plain elements beside it. + if ( + !text || + element == null || + !['Plain string', 'Saved', 'now'].includes(text) + ) { + continue; + } + const color = getComputedStyle(element).color; + if (color !== surface) { + out.push(`"${text}": ${color} instead of ${surface}`); + } + } + } + return out; + }); + mismatches.push(...found.map(mismatch => `${mode}: ${mismatch}`)); + } + expect(mismatches).toEqual([]); + }); +} diff --git a/packages/core/src/Tooltip/useTooltip.tsx b/packages/core/src/Tooltip/useTooltip.tsx index f545fe4dd485e..67daf0786b977 100644 --- a/packages/core/src/Tooltip/useTooltip.tsx +++ b/packages/core/src/Tooltip/useTooltip.tsx @@ -105,6 +105,21 @@ const styles = stylex.create({ // Position-based margin styles // Content wrapper for padding content: { + // Content colored by the primary, secondary or accent tokens, such as + // `Text`, takes the theme's text roles for the inverted surface. + [colorVars['--color-text-primary']]: + colorVars['--color-text-primary-inverted'], + [colorVars['--color-text-secondary']]: + colorVars['--color-text-secondary-inverted'], + [colorVars['--color-text-accent']]: + colorVars['--color-text-accent-inverted'], + [colorVars['--color-icon-primary']]: + colorVars['--color-text-primary-inverted'], + [colorVars['--color-icon-secondary']]: + colorVars['--color-text-secondary-inverted'], + [colorVars['--color-icon-accent']]: + colorVars['--color-text-accent-inverted'], + [colorVars['--color-accent']]: colorVars['--color-text-accent-inverted'], paddingBlockStart: spacingVars['--spacing-1'], paddingBlockEnd: spacingVars['--spacing-1'], paddingInlineStart: spacingVars['--spacing-2'], diff --git a/packages/core/src/theme/statusColor.ts b/packages/core/src/theme/statusColor.ts index 202edf1744cb3..dcd6cfbae80fc 100644 --- a/packages/core/src/theme/statusColor.ts +++ b/packages/core/src/theme/statusColor.ts @@ -3,9 +3,10 @@ /** * @file statusColor.ts * @input Concrete sRGB colours (hex or rgb()) from resolved theme tokens - * @output Contrast, OKLCH, chroma, and lightness-solving helpers for status roles + * @output Contrast, OKLCH, chroma, lightness-solving and readable-ink helpers * @position Pure colour maths shared by status-role derivation - * (architecture:theme-compilation INV17) and the status contrast checks. + * (architecture:theme-compilation INV17), the tooltip text roles and the + * status contrast checks. * * Contrast follows WCAG 2.x relative luminance. Lightness adjustments move a * colour along OKLCH lightness at its own hue, reducing chroma only as far as @@ -161,15 +162,49 @@ export function solveLightness( const mid = (lo + hi) / 2; const ok = passes(at(mid)); if (darker) { - if (ok) {lo = mid;} - else {hi = mid;} - } else if (ok) {hi = mid;} - else {lo = mid;} + if (ok) { + lo = mid; + } else { + hi = mid; + } + } else if (ok) { + hi = mid; + } else { + lo = mid; + } } const solved = at(darker ? lo : hi); return passes(solved) ? solved : target; } +/** The WCAG 2.x floor for normal text. */ +export const TEXT_RATIO = 4.5; + +/** Solve slightly above the floor so rounding to #RRGGBB never lands below it. */ +export const SOLVE_RATIO = TEXT_RATIO + 0.08; + +const WHITE: RGBA = {r: 255, g: 255, b: 255, a: 1}; +const BLACK: RGBA = {r: 0, g: 0, b: 0, a: 1}; + +/** A colour as painted over `under`. */ +export function opaqueOver(color: RGBA, under: RGBA): RGBA { + return color.a < 1 ? composite(color, under) : color; +} + +/** + * `ink` when it meets the text floor on `fill`, else pure white or black, + * whichever reads better. A theme's off-white and off-black can both miss + * the floor on a mid-tone fill; pure white or black always reaches it. + */ +export function readableInk(ink: RGBA, fill: RGBA): RGBA { + if (contrastRatio(ink, fill) >= TEXT_RATIO) { + return ink; + } + return contrastRatio(WHITE, fill) >= contrastRatio(BLACK, fill) + ? WHITE + : BLACK; +} + /** Parse a concrete colour, returning null for anything unresolved. */ export function parseConcreteColor(value: string | undefined): RGBA | null { return value === undefined ? null : parseColor(value); diff --git a/packages/core/src/theme/statusRoleDefaults.ts b/packages/core/src/theme/statusRoleDefaults.ts index 69548c18bcd0f..83a7ff5bd27be 100644 --- a/packages/core/src/theme/statusRoleDefaults.ts +++ b/packages/core/src/theme/statusRoleDefaults.ts @@ -14,6 +14,7 @@ import type {ResolvedThemeAdaptationRule} from './themeAdaptations'; import {deriveStatusRoleTokens} from './statusRoleDerivation'; +import {deriveTooltipTextTokens} from './tooltipTextDerivation'; import { analyzeDeclarationValue, canonicalizeDeclarationName, @@ -268,10 +269,10 @@ export function generatedScopedStatusRoleDefaults( // Roles the theme leaves unset come from its own surfaces first. The // aliases below count them as set, so icon and border roles follow a // derived text role. - const entries: [string, string][] = deriveStatusRoleTokens( - tokens, - localTokens, - ); + const entries: [string, string][] = [ + ...deriveStatusRoleTokens(tokens, localTokens), + ...deriveTooltipTextTokens(tokens, localTokens), + ]; const authoredRoot = createTokenCascade( tokens, Object.fromEntries(entries), diff --git a/packages/core/src/theme/statusRoleDerivation.ts b/packages/core/src/theme/statusRoleDerivation.ts index 2038c832dd90e..c1875504c5725 100644 --- a/packages/core/src/theme/statusRoleDerivation.ts +++ b/packages/core/src/theme/statusRoleDerivation.ts @@ -23,10 +23,13 @@ import {colorDefaults} from './tokens.stylex'; import { + SOLVE_RATIO, composite, contrastRatio, isChromatic, + opaqueOver, parseConcreteColor, + readableInk, solveLightness, toHex, } from './statusColor'; @@ -37,9 +40,6 @@ export type StatusName = (typeof STATUS_NAMES)[number]; type ResolvedThemeMode = 'light' | 'dark'; -const TEXT_RATIO = 4.5; -// Solve slightly above the floor so rounding to #RRGGBB never lands below it. -const SOLVE_RATIO = TEXT_RATIO + 0.08; const MODES: ReadonlyArray = ['light', 'dark']; /** The strong fill of a status, the source its other roles derive from. */ @@ -162,10 +162,6 @@ function statusHue( return fallback === null ? null : {...fallback, a: 1}; } -function opaqueOver(color: RGBA, under: RGBA): RGBA { - return color.a < 1 ? composite(color, under) : color; -} - interface ModeRoles { on?: RGBA; text?: RGBA; @@ -209,16 +205,7 @@ function deriveForMode( contrastRatio(lightInk, fill) >= contrastRatio(darkInk, fill) ? lightInk : darkInk; - // A theme's off-white and off-black content can both miss the floor on a - // mid-tone fill; pure white or black always reaches it. - const white = {r: 255, g: 255, b: 255, a: 1}; - const black = {r: 0, g: 0, b: 0, a: 1}; - roles.on = - contrastRatio(themeInk, fill) >= TEXT_RATIO - ? themeInk - : contrastRatio(white, fill) >= contrastRatio(black, fill) - ? white - : black; + roles.on = readableInk(themeInk, fill); const text = solveLightness(hue, [opaqueSurface, card], SOLVE_RATIO); if (text !== null) { diff --git a/packages/core/src/theme/tokens.stylex.ts b/packages/core/src/theme/tokens.stylex.ts index 7ca09a989079c..27822ac999e73 100644 --- a/packages/core/src/theme/tokens.stylex.ts +++ b/packages/core/src/theme/tokens.stylex.ts @@ -59,6 +59,12 @@ export const colorDefaults = { '--color-background-popover': 'light-dark(#FFFFFF, #28292C)', '--color-background-inverted': 'light-dark(#0A1317, #FFFFFF)', '--color-background-error-inverted': 'light-dark(#AA071E, #E3193B)', + // Text on the inverted surface (a tooltip): the surface's own text colour, + // and the secondary text and the accent stepped to 4.5:1 on that surface. + // A theme that sets none of them gets values from tooltipTextDerivation. + '--color-text-primary-inverted': 'light-dark(#FFFFFF, #1F1F22)', + '--color-text-secondary-inverted': 'light-dark(#6D8090, #71767C)', + '--color-text-accent-inverted': 'light-dark(#2279F6, #0171E3)', // Status fills (architecture:theme-tokens INV11). Each `--color-` is // the strong status fill, and `--color-on-` is content on it at diff --git a/packages/core/src/theme/tooltipTextDerivation.test.ts b/packages/core/src/theme/tooltipTextDerivation.test.ts new file mode 100644 index 0000000000000..545c8ba58038e --- /dev/null +++ b/packages/core/src/theme/tooltipTextDerivation.test.ts @@ -0,0 +1,106 @@ +// Copyright (c) Meta Platforms, Inc. and affiliates. + +/** + * @file tooltipTextDerivation.test.ts + * @input Core's colour defaults and two theme fixtures: a dark inverted + * surface on a light page, and a light one on a dark page + * @output Proves architecture:theme-tokens INV15: each derived text role on + * the inverted surface meets 4.5:1 in light and dark, and a role the theme + * sets is kept + * @position Unit test for the generation step in tooltipTextDerivation.ts + */ + +import {describe, expect, it} from 'vitest'; +import { + coreTooltipTextValues, + deriveTooltipTextTokens, + TOOLTIP_TEXT_TOKENS, +} from './tooltipTextDerivation'; +import {contrastRatio, parseConcreteColor} from './statusColor'; +import {resolveModes} from './statusRoleDerivation'; +import {colorDefaults} from './tokens.stylex'; + +function ratiosOn( + roles: Record, + tokens: Record, +): number[] { + const resolved = resolveModes({...tokens, ...roles}); + return (['light', 'dark'] as const).flatMap(mode => { + const fill = parseConcreteColor( + resolved[mode]['--color-background-inverted'], + ); + return TOOLTIP_TEXT_TOKENS.map(token => { + const ink = parseConcreteColor(resolved[mode][token]); + if (fill === null || ink === null) { + throw new Error(`${token} or the inverted surface is not a colour`); + } + return contrastRatio(ink, fill); + }); + }); +} + +describe('tooltip text roles (architecture:theme-tokens INV15)', () => { + it("holds Core's computed values in Core's defaults", () => { + const computed = coreTooltipTextValues(); + for (const token of TOOLTIP_TEXT_TOKENS) { + expect(colorDefaults[token as keyof typeof colorDefaults]).toBe( + computed[token], + ); + } + for (const ratio of ratiosOn({}, {})) { + expect(ratio).toBeGreaterThanOrEqual(4.5); + } + }); + + // Pale secondary text and a dark accent on a near-black inverted surface, + // and the reverse: each role has to move to reach 4.5:1. + const fixtures: Record> = { + 'dark inverted surface': { + '--color-background-surface': 'light-dark(#f7f4ee, #101314)', + '--color-background-inverted': 'light-dark(#101314, #f0ede6)', + '--color-text-secondary': 'light-dark(#5b6168, #b9bec4)', + '--color-accent': 'light-dark(#2e3a1c, #c9d6a8)', + }, + 'light inverted surface': { + '--color-background-surface': 'light-dark(#ffffff, #1a1c14)', + '--color-background-inverted': 'light-dark(#2f3826, #e8eddc)', + '--color-text-secondary': 'light-dark(#6d7564, #a9b39a)', + '--color-accent': 'light-dark(#4d5638, #aab788)', + }, + }; + for (const [name, tokens] of Object.entries(fixtures)) { + it(`meets 4.5:1 on a ${name}, light and dark`, () => { + const derived = Object.fromEntries(deriveTooltipTextTokens(tokens)); + expect(Object.keys(derived).sort()).toEqual( + [...TOOLTIP_TEXT_TOKENS].sort(), + ); + for (const ratio of ratiosOn(derived, tokens)) { + expect(ratio).toBeGreaterThanOrEqual(4.5); + } + }); + } + + it('gives an accent equal to the inverted surface the secondary value', () => { + const derived = Object.fromEntries( + deriveTooltipTextTokens({ + '--color-background-surface': '#101314', + '--color-background-inverted': '#e8f1f6', + '--color-text-secondary': '#96a0ab', + '--color-accent': '#e8f1f6', + }), + ); + expect(derived['--color-text-accent-inverted']).toBe( + derived['--color-text-secondary-inverted'], + ); + }); + + it('keeps a role the theme sets', () => { + const derived = deriveTooltipTextTokens({ + '--color-background-inverted': '#101010', + '--color-text-secondary-inverted': '#abcdef', + }); + expect(derived.map(([token]) => token)).not.toContain( + '--color-text-secondary-inverted', + ); + }); +}); diff --git a/packages/core/src/theme/tooltipTextDerivation.ts b/packages/core/src/theme/tooltipTextDerivation.ts new file mode 100644 index 0000000000000..0590c7f4a1ee2 --- /dev/null +++ b/packages/core/src/theme/tooltipTextDerivation.ts @@ -0,0 +1,121 @@ +// Copyright (c) Meta Platforms, Inc. and affiliates. + +/** + * @file tooltipTextDerivation.ts + * @input A theme's portable and local token maps + * @output Concrete values for the text roles on the inverted surface that the + * theme does not set + * @position Theme generation step, called with the status-role derivation for + * the theme root. It reads the theme's resolved colours once, at + * generation, so a page measures nothing at runtime. + */ + +import { + SOLVE_RATIO, + opaqueOver, + parseConcreteColor, + readableInk, + solveLightness, + toHex, +} from './statusColor'; +import {resolveModes} from './statusRoleDerivation'; +import type {RGBA} from '../utils/color'; + +const WHITE: RGBA = {r: 255, g: 255, b: 255, a: 1}; + +export const TOOLTIP_TEXT_TOKENS = [ + '--color-text-primary-inverted', + '--color-text-secondary-inverted', + '--color-text-accent-inverted', +] as const; + +/** Colours the tooltip text roles are measured against or start from. */ +const MEASURED = [ + '--color-background-inverted', + '--color-background-surface', + '--color-text-secondary', + '--color-accent', +]; + +function deriveForMode(resolved: Record): RGBA[] | null { + const surface = parseConcreteColor(resolved['--color-background-surface']); + const inverted = parseConcreteColor(resolved['--color-background-inverted']); + const secondary = parseConcreteColor(resolved['--color-text-secondary']); + const accent = parseConcreteColor(resolved['--color-accent']); + if ( + surface === null || + inverted === null || + secondary === null || + accent === null + ) { + return null; + } + const page = opaqueOver(surface, WHITE); + const fill = opaqueOver(inverted, page); + const ink = opaqueOver(surface, fill); + const primary = readableInk(ink, fill); + const muted = solveLightness( + opaqueOver(secondary, page), + [fill], + SOLVE_RATIO, + ); + const accentOnPage = opaqueOver(accent, page); + // An accent that is the surface itself has no colour to show there, so it + // reads as secondary text. + const accentText = + accentOnPage.r === fill.r && + accentOnPage.g === fill.g && + accentOnPage.b === fill.b + ? muted + : solveLightness(accentOnPage, [fill], SOLVE_RATIO); + if (muted === null || accentText === null) { + return null; + } + return [primary, muted, accentText]; +} + +/** + * Concrete `light-dark()` values for the tooltip text roles a theme leaves + * unset. Authored roles are never overridden. Nothing is derived when a + * colour cannot be read; the roles then keep Core's values. + */ +export function deriveTooltipTextTokens( + tokens: Record, + localTokens: Record = {}, +): [string, string][] { + const authored = new Set(Object.keys(tokens)); + if (!MEASURED.some(token => authored.has(token))) { + return []; + } + const resolved = resolveModes({...localTokens, ...tokens}); + const light = deriveForMode(resolved.light); + const dark = deriveForMode(resolved.dark); + if (light === null || dark === null) { + return []; + } + return TOOLTIP_TEXT_TOKENS.filter(token => !authored.has(token)).map( + token => { + const index = TOOLTIP_TEXT_TOKENS.indexOf(token); + return [ + token, + `light-dark(${toHex(light[index])}, ${toHex(dark[index])})`, + ]; + }, + ); +} + +/** Core's own tooltip text roles, from Core's colour defaults. */ +export function coreTooltipTextValues(): Record { + const resolved = resolveModes({}); + const light = deriveForMode(resolved.light); + const dark = deriveForMode(resolved.dark); + if (light === null || dark === null) { + return {}; + } + return Object.fromEntries( + TOOLTIP_TEXT_TOKENS.map((token, index) => [ + token, + `light-dark(${toHex(light[index])}, ${toHex(dark[index])})`, + ]), + ); +} diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift index 6dd10d91b02a4..64129d20a7132 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/ButterTheme.swift @@ -161,6 +161,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.3215686274509804, green: 0.13725490196078433, blue: 0.4823529411764706, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.3764705882352941, green: 0.37254901960784315, blue: 0.3215686274509804, opacity: 1), textAccent: Color(.sRGB, red: 0.13333333333333333, green: 0.3568627450980392, blue: 1, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.30196078431372547, green: 0.5098039215686274, blue: 1, opacity: 1), textBlue: Color(.sRGB, red: 0.12549019607843137, green: 0.22745098039215686, blue: 0.4235294117647059, opacity: 1), textCyan: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.28627450980392155, opacity: 1), textDisabled: Color(.sRGB, red: 0.6784313725490196, green: 0.6745098039215687, blue: 0.6196078431372549, opacity: 1), @@ -171,9 +172,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.1803921568627451, blue: 0, opacity: 1), textPink: Color(.sRGB, red: 0.4235294117647059, green: 0.0392156862745098, blue: 0.40784313725490196, opacity: 1), textPrimary: Color(.sRGB, red: 0.11372549019607843, green: 0.10980392156862745, blue: 0.06666666666666667, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1), textPurple: Color(.sRGB, red: 0.3215686274509804, green: 0.13725490196078433, blue: 0.4823529411764706, opacity: 1), textRed: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1), textSecondary: Color(.sRGB, red: 0.3764705882352941, green: 0.37254901960784315, blue: 0.3215686274509804, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.5372549019607843, green: 0.5294117647058824, blue: 0.47843137254901963, opacity: 1), textSuccess: Color(.sRGB, red: 0, green: 0.2901960784313726, blue: 0.0196078431372549, opacity: 1), textTeal: Color(.sRGB, red: 0, green: 0.2823529411764706, blue: 0.17647058823529413, opacity: 1), textWarning: Color(.sRGB, red: 0.26666666666666666, green: 0.23529411764705882, blue: 0, opacity: 1), @@ -394,6 +397,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.8666666666666667, green: 0.7254901960784313, blue: 0.9647058823529412, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.6784313725490196, green: 0.6745098039215687, blue: 0.6196078431372549, opacity: 1), textAccent: Color(.sRGB, red: 0.9921568627450981, green: 0.9333333333333333, blue: 0.5490196078431373, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.4745098039215686, green: 0.4196078431372549, blue: 0, opacity: 1), textBlue: Color(.sRGB, red: 0.12549019607843137, green: 0.22745098039215686, blue: 0.4235294117647059, opacity: 1), textCyan: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.28627450980392155, opacity: 1), textDisabled: Color(.sRGB, red: 0.3764705882352941, green: 0.37254901960784315, blue: 0.3215686274509804, opacity: 1), @@ -404,9 +408,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.1803921568627451, blue: 0, opacity: 1), textPink: Color(.sRGB, red: 0.4235294117647059, green: 0.0392156862745098, blue: 0.40784313725490196, opacity: 1), textPrimary: Color(.sRGB, red: 0.9529411764705882, green: 0.9490196078431372, blue: 0.8862745098039215, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.1803921568627451, green: 0.12941176470588237, blue: 0.09019607843137255, opacity: 1), textPurple: Color(.sRGB, red: 0.3215686274509804, green: 0.13725490196078433, blue: 0.4823529411764706, opacity: 1), textRed: Color(.sRGB, red: 0.43529411764705883, green: 0.0784313725490196, blue: 0, opacity: 1), textSecondary: Color(.sRGB, red: 0.6784313725490196, green: 0.6745098039215687, blue: 0.6196078431372549, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.4235294117647059, green: 0.4235294117647059, blue: 0.3686274509803922, opacity: 1), textSuccess: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.6509803921568628, opacity: 1), textTeal: Color(.sRGB, red: 0, green: 0.2823529411764706, blue: 0.17647058823529413, opacity: 1), textWarning: Color(.sRGB, red: 0.9333333333333333, green: 0.8745098039215686, blue: 0.4588235294117647, opacity: 1), diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift index 2189f79a6b038..4db8f04108fb0 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/ChocolateTheme.swift @@ -161,6 +161,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.4196078431372549, green: 0.2901960784313726, blue: 0.5490196078431373, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1), textAccent: Color(.sRGB, red: 0.5490196078431373, green: 0.34901960784313724, blue: 0.15294117647058825, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.8117647058823529, green: 0.596078431372549, blue: 0.4, opacity: 1), textBlue: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1), textCyan: Color(.sRGB, red: 0.17647058823529413, green: 0.37254901960784315, blue: 0.37254901960784315, opacity: 1), textDisabled: Color(.sRGB, red: 0.7686274509803922, green: 0.6745098039215687, blue: 0.5843137254901961, opacity: 1), @@ -171,9 +172,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.5372549019607843, green: 0.2901960784313726, blue: 0.01568627450980392, opacity: 1), textPink: Color(.sRGB, red: 0.5882352941176471, green: 0.19215686274509805, blue: 0.3215686274509804, opacity: 1), textPrimary: Color(.sRGB, red: 0.2901960784313726, green: 0.20784313725490197, blue: 0.12549019607843137, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 1, green: 0.9882352941176471, blue: 0.9686274509803922, opacity: 1), textPurple: Color(.sRGB, red: 0.3333333333333333, green: 0.22745098039215686, blue: 0.4392156862745098, opacity: 1), textRed: Color(.sRGB, red: 0.6588235294117647, green: 0, blue: 0, opacity: 1), textSecondary: Color(.sRGB, red: 0.5372549019607843, green: 0.30196078431372547, blue: 0.054901960784313725, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.8431372549019608, green: 0.5843137254901961, blue: 0.3686274509803922, opacity: 1), textSuccess: Color(.sRGB, red: 0.3215686274509804, green: 0.43529411764705883, blue: 0, opacity: 1), textTeal: Color(.sRGB, red: 0.1411764705882353, green: 0.3333333333333333, blue: 0.27450980392156865, opacity: 1), textWarning: Color(.sRGB, red: 0.47843137254901963, green: 0.3333333333333333, blue: 0, opacity: 1), @@ -394,6 +397,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.6901960784313725, green: 0.5568627450980392, blue: 0.8313725490196079, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.9294117647058824, green: 0.8941176470588236, blue: 0.8313725490196079, opacity: 1), textAccent: Color(.sRGB, red: 0.8313725490196079, green: 0.6274509803921569, blue: 0.41568627450980394, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.5450980392156862, green: 0.3568627450980392, blue: 0.1411764705882353, opacity: 1), textBlue: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1), textCyan: Color(.sRGB, red: 0.5098039215686274, green: 0.8313725490196079, blue: 0.8313725490196079, opacity: 1), textDisabled: Color(.sRGB, red: 0.4196078431372549, green: 0.3333333333333333, blue: 0.25098039215686274, opacity: 1), @@ -404,9 +408,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.8784313725490196, green: 0.6274509803921569, blue: 0.2901960784313726, opacity: 1), textPink: Color(.sRGB, red: 0.9411764705882353, green: 0.5411764705882353, blue: 0.6666666666666666, opacity: 1), textPrimary: Color(.sRGB, red: 0.9294117647058824, green: 0.8941176470588236, blue: 0.8313725490196079, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.10980392156862745, green: 0.08627450980392157, blue: 0.06274509803921569, opacity: 1), textPurple: Color(.sRGB, red: 0.7529411764705882, green: 0.6274509803921569, blue: 0.8784313725490196, opacity: 1), textRed: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1), textSecondary: Color(.sRGB, red: 0.7686274509803922, green: 0.6588235294117647, blue: 0.5098039215686274, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.4823529411764706, green: 0.3803921568627451, blue: 0.24313725490196078, opacity: 1), textSuccess: Color(.sRGB, red: 0.6588235294117647, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1), textTeal: Color(.sRGB, red: 0.4235294117647059, green: 0.792156862745098, blue: 0.6666666666666666, opacity: 1), textWarning: Color(.sRGB, red: 1, green: 0.8509803921568627, blue: 0.3764705882352941, opacity: 1), diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift index 875744335fd14..679e4a5e963ff 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/DefaultTheme.swift @@ -161,6 +161,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.24313725490196078, green: 0.023529411764705882, blue: 0.592156862745098, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.0392156862745098, green: 0.07450980392156863, blue: 0.09019607843137255, opacity: 1), textAccent: Color(.sRGB, red: 0, green: 0.39215686274509803, blue: 0.8784313725490196, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.13333333333333333, green: 0.4745098039215686, blue: 0.9647058823529412, opacity: 1), textBlue: Color(.sRGB, red: 0.01568627450980392, green: 0.1843137254901961, blue: 0.592156862745098, opacity: 1), textCyan: Color(.sRGB, red: 0.00392156862745098, green: 0.28627450980392155, blue: 0.4588235294117647, opacity: 1), textDisabled: Color(.sRGB, red: 0.6431372549019608, green: 0.6901960784313725, blue: 0.7372549019607844, opacity: 1), @@ -171,9 +172,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.4196078431372549, green: 0.13333333333333333, blue: 0.011764705882352941, opacity: 1), textPink: Color(.sRGB, red: 0.396078431372549, green: 0, blue: 0.3254901960784314, opacity: 1), textPrimary: Color(.sRGB, red: 0.0392156862745098, green: 0.07450980392156863, blue: 0.09019607843137255, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1), textPurple: Color(.sRGB, red: 0.24313725490196078, green: 0.023529411764705882, blue: 0.592156862745098, opacity: 1), textRed: Color(.sRGB, red: 0.4823529411764706, green: 0.00784313725490196, blue: 0.06274509803921569, opacity: 1), textSecondary: Color(.sRGB, red: 0.26666666666666666, green: 0.3333333333333333, blue: 0.39215686274509803, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.42745098039215684, green: 0.5019607843137255, blue: 0.5647058823529412, opacity: 1), textSuccess: Color(.sRGB, red: 0.03529411764705882, green: 0.26666666666666666, blue: 0.12156862745098039, opacity: 1), textTeal: Color(.sRGB, red: 0.03137254901960784, green: 0.2235294117647059, blue: 0.2627450980392157, opacity: 1), textWarning: Color(.sRGB, red: 0.4588235294117647, green: 0.24705882352941178, blue: 0.027450980392156862, opacity: 1), @@ -394,6 +397,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.7019607843137254, green: 0.6901960784313725, blue: 0.996078431372549, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.8745098039215686, green: 0.8862745098039215, blue: 0.8980392156862745, opacity: 1), textAccent: Color(.sRGB, red: 0.24313725490196078, green: 0.6196078431372549, blue: 0.984313725490196, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.00392156862745098, green: 0.44313725490196076, blue: 0.8901960784313725, opacity: 1), textBlue: Color(.sRGB, red: 0.6862745098039216, green: 0.8431372549019608, blue: 1, opacity: 1), textCyan: Color(.sRGB, red: 0.6313725490196078, green: 0.9333333333333333, blue: 0.9764705882352941, opacity: 1), textDisabled: Color(.sRGB, red: 0.43529411764705883, green: 0.4549019607843137, blue: 0.48627450980392156, opacity: 1), @@ -404,9 +408,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.9921568627450981, green: 0.7215686274509804, blue: 0.4627450980392157, opacity: 1), textPink: Color(.sRGB, red: 0.996078431372549, green: 0.6784313725490196, blue: 0.8901960784313725, opacity: 1), textPrimary: Color(.sRGB, red: 0.8745098039215686, green: 0.8862745098039215, blue: 0.8980392156862745, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.12156862745098039, green: 0.12156862745098039, blue: 0.13333333333333333, opacity: 1), textPurple: Color(.sRGB, red: 0.7019607843137254, green: 0.6901960784313725, blue: 0.996078431372549, opacity: 1), textRed: Color(.sRGB, red: 1, green: 0.6980392156862745, blue: 0.7215686274509804, opacity: 1), textSecondary: Color(.sRGB, red: 0.6901960784313725, green: 0.7098039215686275, blue: 0.7333333333333333, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.44313725490196076, green: 0.4627450980392157, blue: 0.48627450980392156, opacity: 1), textSuccess: Color(.sRGB, red: 0.6470588235294118, green: 0.9647058823529412, blue: 0.5647058823529412, opacity: 1), textTeal: Color(.sRGB, red: 0.25098039215686274, green: 0.8627450980392157, blue: 0.803921568627451, opacity: 1), textWarning: Color(.sRGB, red: 0.984313725490196, green: 0.807843137254902, blue: 0.011764705882352941, opacity: 1), diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift index 9e8422410bb73..034fe10645b6e 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/GothicTheme.swift @@ -161,6 +161,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.7647058823529411, green: 0.6039215686274509, blue: 0.8588235294117647, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1), textAccent: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.3686274509803922, green: 0.403921568627451, blue: 0.43137254901960786, opacity: 1), textBlue: Color(.sRGB, red: 0.12156862745098039, green: 0.17254901960784313, blue: 0.32941176470588235, opacity: 1), textCyan: Color(.sRGB, red: 0.12549019607843137, green: 0.2823529411764706, blue: 0.34509803921568627, opacity: 1), textDisabled: Color(.sRGB, red: 0.28627450980392155, green: 0.3137254901960784, blue: 0.33725490196078434, opacity: 1), @@ -171,9 +172,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.43137254901960786, green: 0.2196078431372549, blue: 0.07058823529411765, opacity: 1), textPink: Color(.sRGB, red: 0.3607843137254902, green: 0.09411764705882353, blue: 0.1843137254901961, opacity: 1), textPrimary: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1), textPurple: Color(.sRGB, red: 0.2823529411764706, green: 0.10588235294117647, blue: 0.34509803921568627, opacity: 1), textRed: Color(.sRGB, red: 0.2901960784313726, green: 0.1450980392156863, blue: 0.12549019607843137, opacity: 1), textSecondary: Color(.sRGB, red: 0.5882352941176471, green: 0.6274509803921569, blue: 0.6705882352941176, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.3686274509803922, green: 0.403921568627451, blue: 0.43137254901960786, opacity: 1), textSuccess: Color(.sRGB, red: 0.7019607843137254, green: 0.7803921568627451, blue: 0.6039215686274509, opacity: 1), textTeal: Color(.sRGB, red: 0.09019607843137255, green: 0.2901960784313726, blue: 0.25098039215686274, opacity: 1), textWarning: Color(.sRGB, red: 0.8274509803921568, green: 0.7686274509803922, blue: 0.5647058823529412, opacity: 1), @@ -394,6 +397,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.7647058823529411, green: 0.6039215686274509, blue: 0.8588235294117647, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1), textAccent: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.3686274509803922, green: 0.403921568627451, blue: 0.43137254901960786, opacity: 1), textBlue: Color(.sRGB, red: 0.12156862745098039, green: 0.17254901960784313, blue: 0.32941176470588235, opacity: 1), textCyan: Color(.sRGB, red: 0.12549019607843137, green: 0.2823529411764706, blue: 0.34509803921568627, opacity: 1), textDisabled: Color(.sRGB, red: 0.28627450980392155, green: 0.3137254901960784, blue: 0.33725490196078434, opacity: 1), @@ -404,9 +408,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.43137254901960786, green: 0.2196078431372549, blue: 0.07058823529411765, opacity: 1), textPink: Color(.sRGB, red: 0.3607843137254902, green: 0.09411764705882353, blue: 0.1843137254901961, opacity: 1), textPrimary: Color(.sRGB, red: 0.9098039215686274, green: 0.9450980392156862, blue: 0.9647058823529412, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.06274509803921569, green: 0.07450980392156863, blue: 0.0784313725490196, opacity: 1), textPurple: Color(.sRGB, red: 0.2823529411764706, green: 0.10588235294117647, blue: 0.34509803921568627, opacity: 1), textRed: Color(.sRGB, red: 0.2901960784313726, green: 0.1450980392156863, blue: 0.12549019607843137, opacity: 1), textSecondary: Color(.sRGB, red: 0.5882352941176471, green: 0.6274509803921569, blue: 0.6705882352941176, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.3686274509803922, green: 0.403921568627451, blue: 0.43137254901960786, opacity: 1), textSuccess: Color(.sRGB, red: 0.7019607843137254, green: 0.7803921568627451, blue: 0.6039215686274509, opacity: 1), textTeal: Color(.sRGB, red: 0.09019607843137255, green: 0.2901960784313726, blue: 0.25098039215686274, opacity: 1), textWarning: Color(.sRGB, red: 0.8274509803921568, green: 0.7686274509803922, blue: 0.5647058823529412, opacity: 1), diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift index 8073776d5c896..7549d3f0a7659 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/MatchaTheme.swift @@ -161,6 +161,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.4196078431372549, green: 0.2901960784313726, blue: 0.5490196078431373, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1), textAccent: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.6666666666666666, green: 0.7098039215686275, blue: 0.5529411764705883, opacity: 1), textBlue: Color(.sRGB, red: 0.1803921568627451, green: 0.2901960784313726, blue: 0.43137254901960786, opacity: 1), textCyan: Color(.sRGB, red: 0.1803921568627451, green: 0.3764705882352941, blue: 0.3764705882352941, opacity: 1), textDisabled: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1), @@ -171,9 +172,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.41568627450980394, green: 0.3137254901960784, blue: 0.19215686274509805, opacity: 1), textPink: Color(.sRGB, red: 0.5490196078431373, green: 0.22745098039215686, blue: 0.22745098039215686, opacity: 1), textPrimary: Color(.sRGB, red: 0.24313725490196078, green: 0.2823529411764706, blue: 0.11372549019607843, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1), textPurple: Color(.sRGB, red: 0.3333333333333333, green: 0.22745098039215686, blue: 0.4392156862745098, opacity: 1), textRed: Color(.sRGB, red: 0.6941176470588235, green: 0, blue: 0, opacity: 1), textSecondary: Color(.sRGB, red: 0.35294117647058826, green: 0.4196078431372549, blue: 0.16470588235294117, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.6666666666666666, green: 0.7098039215686275, blue: 0.5529411764705883, opacity: 1), textSuccess: Color(.sRGB, red: 0.23921568627450981, green: 0.47843137254901963, blue: 0, opacity: 1), textTeal: Color(.sRGB, red: 0.1411764705882353, green: 0.3333333333333333, blue: 0.27450980392156865, opacity: 1), textWarning: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1), @@ -394,6 +397,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.6901960784313725, green: 0.5568627450980392, blue: 0.8313725490196079, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1), textAccent: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.2980392156862745, green: 0.3333333333333333, blue: 0.1803921568627451, opacity: 1), textBlue: Color(.sRGB, red: 0.5529411764705883, green: 0.7372549019607844, blue: 0.8784313725490196, opacity: 1), textCyan: Color(.sRGB, red: 0.5098039215686274, green: 0.8313725490196079, blue: 0.8313725490196079, opacity: 1), textDisabled: Color(.sRGB, red: 0.35294117647058826, green: 0.39215686274509803, blue: 0.25098039215686274, opacity: 1), @@ -404,9 +408,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.8784313725490196, green: 0.6274509803921569, blue: 0.2901960784313726, opacity: 1), textPink: Color(.sRGB, red: 0.9411764705882353, green: 0.5411764705882353, blue: 0.6666666666666666, opacity: 1), textPrimary: Color(.sRGB, red: 0.7529411764705882, green: 0.796078431372549, blue: 0.6627450980392157, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.10196078431372549, green: 0.10980392156862745, blue: 0.0784313725490196, opacity: 1), textPurple: Color(.sRGB, red: 0.7529411764705882, green: 0.6274509803921569, blue: 0.8784313725490196, opacity: 1), textRed: Color(.sRGB, red: 1, green: 0.47843137254901963, blue: 0.47843137254901963, opacity: 1), textSecondary: Color(.sRGB, red: 0.6588235294117647, green: 0.7490196078431373, blue: 0.41568627450980394, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.2980392156862745, green: 0.3333333333333333, blue: 0.1803921568627451, opacity: 1), textSuccess: Color(.sRGB, red: 0.5019607843137255, green: 0.8313725490196079, blue: 0.22745098039215686, opacity: 1), textTeal: Color(.sRGB, red: 0.4235294117647059, green: 0.792156862745098, blue: 0.6666666666666666, opacity: 1), textWarning: Color(.sRGB, red: 1, green: 0.8784313725490196, blue: 0.5450980392156862, opacity: 1), diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift index f627043572fba..721aa8a895d03 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/NeutralTheme.swift @@ -161,6 +161,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.4196078431372549, green: 0.09411764705882353, blue: 0.48627450980392156, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.06666666666666667, green: 0.06666666666666667, blue: 0.06666666666666667, opacity: 1), textAccent: Color(.sRGB, red: 0.10588235294117647, green: 0.10588235294117647, blue: 0.10588235294117647, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.49019607843137253, green: 0.49019607843137253, blue: 0.49019607843137253, opacity: 1), textBlue: Color(.sRGB, red: 0, green: 0.2235294117647059, blue: 0.47058823529411764, opacity: 1), textCyan: Color(.sRGB, red: 0, green: 0.2627450980392157, blue: 0.3176470588235294, opacity: 1), textDisabled: Color(.sRGB, red: 0.5686274509803921, green: 0.5686274509803921, blue: 0.5686274509803921, opacity: 1), @@ -171,9 +172,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.3843137254901961, green: 0.15294117647058825, blue: 0, opacity: 1), textPink: Color(.sRGB, red: 0.4392156862745098, green: 0, blue: 0.24705882352941178, opacity: 1), textPrimary: Color(.sRGB, red: 0, green: 0, blue: 0, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1), textPurple: Color(.sRGB, red: 0.3607843137254902, green: 0.054901960784313725, blue: 0.4235294117647059, opacity: 1), textRed: Color(.sRGB, red: 0.4627450980392157, green: 0, blue: 0.047058823529411764, opacity: 1), textSecondary: Color(.sRGB, red: 0.2784313725490196, green: 0.2784313725490196, blue: 0.2784313725490196, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.49019607843137253, green: 0.49019607843137253, blue: 0.49019607843137253, opacity: 1), textSuccess: Color(.sRGB, red: 0.1843137254901961, green: 0.49019607843137253, blue: 0.2, opacity: 1), textTeal: Color(.sRGB, red: 0, green: 0.27450980392156865, blue: 0.23921568627450981, opacity: 1), textWarning: Color(.sRGB, red: 0.5137254901960784, green: 0.403921568627451, blue: 0, opacity: 1), @@ -394,6 +397,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.9372549019607843, green: 0.6588235294117647, blue: 1, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.8862745098039215, green: 0.8862745098039215, blue: 0.8862745098039215, opacity: 1), textAccent: Color(.sRGB, red: 0.9450980392156862, green: 0.9450980392156862, blue: 0.9450980392156862, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.4588235294117647, green: 0.4588235294117647, blue: 0.4588235294117647, opacity: 1), textBlue: Color(.sRGB, red: 0.6313725490196078, green: 0.792156862745098, blue: 1, opacity: 1), textCyan: Color(.sRGB, red: 0.5215686274509804, green: 0.8352941176470589, blue: 0.9137254901960784, opacity: 1), textDisabled: Color(.sRGB, red: 0.3215686274509804, green: 0.3215686274509804, blue: 0.3215686274509804, opacity: 1), @@ -404,9 +408,11 @@ extension Theme { textOrange: Color(.sRGB, red: 1, green: 0.7019607843137254, blue: 0.49411764705882355, opacity: 1), textPink: Color(.sRGB, red: 1, green: 0.6627450980392157, blue: 0.792156862745098, opacity: 1), textPrimary: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.14901960784313725, green: 0.14901960784313725, blue: 0.14901960784313725, opacity: 1), textPurple: Color(.sRGB, red: 0.9176470588235294, green: 0.6745098039215687, blue: 0.9725490196078431, opacity: 1), textRed: Color(.sRGB, red: 1, green: 0.6823529411764706, blue: 0.6549019607843137, opacity: 1), textSecondary: Color(.sRGB, red: 0.6196078431372549, green: 0.6196078431372549, blue: 0.6196078431372549, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.4588235294117647, green: 0.4588235294117647, blue: 0.4588235294117647, opacity: 1), textSuccess: Color(.sRGB, red: 0.5647058823529412, green: 0.792156862745098, blue: 0.5647058823529412, opacity: 1), textTeal: Color(.sRGB, red: 0.5647058823529412, green: 0.8431372549019608, blue: 0.7843137254901961, opacity: 1), textWarning: Color(.sRGB, red: 0.9333333333333333, green: 0.7686274509803922, blue: 0.2823529411764706, opacity: 1), diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift index ea040e90c5249..f87777b335065 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/StoneTheme.swift @@ -161,6 +161,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.38823529411764707, green: 0.35294117647058826, blue: 0.4392156862745098, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.37254901960784315, green: 0.37254901960784315, blue: 0.39215686274509803, opacity: 1), textAccent: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.5686274509803921, green: 0.5686274509803921, blue: 0.592156862745098, opacity: 1), textBlue: Color(.sRGB, red: 0.20392156862745098, green: 0.2823529411764706, blue: 0.3803921568627451, opacity: 1), textCyan: Color(.sRGB, red: 0.14901960784313725, green: 0.30196078431372547, blue: 0.3411764705882353, opacity: 1), textDisabled: Color(.sRGB, red: 0.8313725490196079, green: 0.8274509803921568, blue: 0.8666666666666667, opacity: 1), @@ -171,9 +172,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.3686274509803922, green: 0.24705882352941178, blue: 0.15294117647058825, opacity: 1), textPink: Color(.sRGB, red: 0.35294117647058826, green: 0.23529411764705882, blue: 0.30980392156862746, opacity: 1), textPrimary: Color(.sRGB, red: 0.1450980392156863, green: 0.1450980392156863, blue: 0.16470588235294117, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1), textPurple: Color(.sRGB, red: 0.2980392156862745, green: 0.25098039215686274, blue: 0.3568627450980392, opacity: 1), textRed: Color(.sRGB, red: 0.3764705882352941, green: 0.23529411764705882, blue: 0.21568627450980393, opacity: 1), textSecondary: Color(.sRGB, red: 0.37254901960784315, green: 0.37254901960784315, blue: 0.39215686274509803, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.5686274509803921, green: 0.5686274509803921, blue: 0.592156862745098, opacity: 1), textSuccess: Color(.sRGB, red: 0.20784313725490197, green: 0.30980392156862746, blue: 0.19215686274509805, opacity: 1), textTeal: Color(.sRGB, red: 0.17254901960784313, green: 0.30980392156862746, blue: 0.26666666666666666, opacity: 1), textWarning: Color(.sRGB, red: 0.3215686274509804, green: 0.2823529411764706, blue: 0.09411764705882353, opacity: 1), @@ -394,6 +397,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.6901960784313725, green: 0.6470588235294118, blue: 0.7529411764705882, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.6705882352941176, green: 0.6705882352941176, blue: 0.7019607843137254, opacity: 1), textAccent: Color(.sRGB, red: 0.9411764705882353, green: 0.9411764705882353, blue: 0.9764705882352941, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.41568627450980394, green: 0.41568627450980394, blue: 0.4392156862745098, opacity: 1), textBlue: Color(.sRGB, red: 0.8352941176470589, green: 0.8941176470588236, blue: 0.9725490196078431, opacity: 1), textCyan: Color(.sRGB, red: 0.8117647058823529, green: 0.9098039215686274, blue: 0.9333333333333333, opacity: 1), textDisabled: Color(.sRGB, red: 0.3686274509803922, green: 0.3686274509803922, blue: 0.39215686274509803, opacity: 1), @@ -404,9 +408,11 @@ extension Theme { textOrange: Color(.sRGB, red: 1, green: 0.8627450980392157, blue: 0.7333333333333333, opacity: 1), textPink: Color(.sRGB, red: 0.9490196078431372, green: 0.8588235294117647, blue: 0.9098039215686274, opacity: 1), textPrimary: Color(.sRGB, red: 0.9411764705882353, green: 0.9411764705882353, blue: 0.9764705882352941, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.10588235294117647, green: 0.10588235294117647, blue: 0.12941176470588237, opacity: 1), textPurple: Color(.sRGB, red: 0.9019607843137255, green: 0.8705882352941177, blue: 0.9529411764705882, opacity: 1), textRed: Color(.sRGB, red: 0.9686274509803922, green: 0.8588235294117647, blue: 0.8431372549019608, opacity: 1), textSecondary: Color(.sRGB, red: 0.6705882352941176, green: 0.6705882352941176, blue: 0.7019607843137254, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.41568627450980394, green: 0.41568627450980394, blue: 0.4392156862745098, opacity: 1), textSuccess: Color(.sRGB, red: 0.8352941176470589, green: 0.9137254901960784, blue: 0.8235294117647058, opacity: 1), textTeal: Color(.sRGB, red: 0.8392156862745098, green: 0.9058823529411765, blue: 0.8823529411764706, opacity: 1), textWarning: Color(.sRGB, red: 0.9450980392156862, green: 0.8823529411764706, blue: 0.7254901960784313, opacity: 1), diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift index 46588d0e8b1e4..e1e1d1e6edfc6 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/Tokens.swift @@ -358,6 +358,8 @@ public struct ColorTokens: Equatable, Sendable { public var syntaxVariable: Color /// `--color-text-accent` public var textAccent: Color + /// `--color-text-accent-inverted` + public var textAccentInverted: Color /// `--color-text-blue` public var textBlue: Color /// `--color-text-cyan` @@ -378,12 +380,16 @@ public struct ColorTokens: Equatable, Sendable { public var textPink: Color /// `--color-text-primary` public var textPrimary: Color + /// `--color-text-primary-inverted` + public var textPrimaryInverted: Color /// `--color-text-purple` public var textPurple: Color /// `--color-text-red` public var textRed: Color /// `--color-text-secondary` public var textSecondary: Color + /// `--color-text-secondary-inverted` + public var textSecondaryInverted: Color /// `--color-text-success` public var textSuccess: Color /// `--color-text-teal` @@ -554,6 +560,7 @@ public struct ColorTokens: Equatable, Sendable { syntaxType: Color, syntaxVariable: Color, textAccent: Color, + textAccentInverted: Color, textBlue: Color, textCyan: Color, textDisabled: Color, @@ -564,9 +571,11 @@ public struct ColorTokens: Equatable, Sendable { textOrange: Color, textPink: Color, textPrimary: Color, + textPrimaryInverted: Color, textPurple: Color, textRed: Color, textSecondary: Color, + textSecondaryInverted: Color, textSuccess: Color, textTeal: Color, textWarning: Color, @@ -728,6 +737,7 @@ public struct ColorTokens: Equatable, Sendable { self.syntaxType = syntaxType self.syntaxVariable = syntaxVariable self.textAccent = textAccent + self.textAccentInverted = textAccentInverted self.textBlue = textBlue self.textCyan = textCyan self.textDisabled = textDisabled @@ -738,9 +748,11 @@ public struct ColorTokens: Equatable, Sendable { self.textOrange = textOrange self.textPink = textPink self.textPrimary = textPrimary + self.textPrimaryInverted = textPrimaryInverted self.textPurple = textPurple self.textRed = textRed self.textSecondary = textSecondary + self.textSecondaryInverted = textSecondaryInverted self.textSuccess = textSuccess self.textTeal = textTeal self.textWarning = textWarning @@ -907,6 +919,7 @@ public struct ColorTokens: Equatable, Sendable { case "color-syntax-type": syntaxType case "color-syntax-variable": syntaxVariable case "color-text-accent": textAccent + case "color-text-accent-inverted": textAccentInverted case "color-text-blue": textBlue case "color-text-cyan": textCyan case "color-text-disabled": textDisabled @@ -917,9 +930,11 @@ public struct ColorTokens: Equatable, Sendable { case "color-text-orange": textOrange case "color-text-pink": textPink case "color-text-primary": textPrimary + case "color-text-primary-inverted": textPrimaryInverted case "color-text-purple": textPurple case "color-text-red": textRed case "color-text-secondary": textSecondary + case "color-text-secondary-inverted": textSecondaryInverted case "color-text-success": textSuccess case "color-text-teal": textTeal case "color-text-warning": textWarning diff --git a/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift b/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift index 99b46b8d5a592..d4756943fea31 100644 --- a/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift +++ b/packages/native/apple/Sources/Astryx/Theme/Generated/Y2kTheme.swift @@ -161,6 +161,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.4, green: 0.24313725490196078, blue: 0.7411764705882353, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.35294117647058826, green: 0.3176470588235294, blue: 0.27450980392156865, opacity: 1), textAccent: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.6039215686274509, green: 0.5607843137254902, blue: 0.5098039215686274, opacity: 1), textBlue: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1), textCyan: Color(.sRGB, red: 0, green: 0.3215686274509804, blue: 0.3137254901960784, opacity: 1), textDisabled: Color(.sRGB, red: 0.8196078431372549, green: 0.7725490196078432, blue: 0.7215686274509804, opacity: 1), @@ -171,9 +172,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.4392156862745098, green: 0.20392156862745098, blue: 0, opacity: 1), textPink: Color(.sRGB, red: 0.5098039215686274, green: 0, blue: 0.30980392156862746, opacity: 1), textPrimary: Color(.sRGB, red: 0.17647058823529413, green: 0.1411764705882353, blue: 0.10588235294117647, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 1, green: 1, blue: 1, opacity: 1), textPurple: Color(.sRGB, red: 0.2627450980392157, green: 0.10196078431372549, blue: 0.5333333333333333, opacity: 1), textRed: Color(.sRGB, red: 0.5333333333333333, green: 0, blue: 0.13725490196078433, opacity: 1), textSecondary: Color(.sRGB, red: 0.35294117647058826, green: 0.3176470588235294, blue: 0.27450980392156865, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.6039215686274509, green: 0.5607843137254902, blue: 0.5098039215686274, opacity: 1), textSuccess: Color(.sRGB, red: 0.24705882352941178, green: 0.3058823529411765, blue: 0, opacity: 1), textTeal: Color(.sRGB, red: 0, green: 0.3333333333333333, blue: 0.23137254901960785, opacity: 1), textWarning: Color(.sRGB, red: 0.34509803921568627, green: 0.26666666666666666, blue: 0, opacity: 1), @@ -394,6 +397,7 @@ extension Theme { syntaxType: Color(.sRGB, red: 0.7333333333333333, green: 0.6666666666666666, blue: 1, opacity: 1), syntaxVariable: Color(.sRGB, red: 0.6509803921568628, green: 0.6745098039215687, blue: 0.8392156862745098, opacity: 1), textAccent: Color(.sRGB, red: 0.9294117647058824, green: 0.9372549019607843, blue: 0.9882352941176471, opacity: 1), + textAccentInverted: Color(.sRGB, red: 0.38823529411764707, green: 0.40784313725490196, blue: 0.5372549019607843, opacity: 1), textBlue: Color(.sRGB, red: 0, green: 0.20392156862745098, blue: 0.32941176470588235, opacity: 1), textCyan: Color(.sRGB, red: 0, green: 0.17647058823529413, blue: 0.17254901960784313, opacity: 1), textDisabled: Color(.sRGB, red: 0.2901960784313726, green: 0.30980392156862746, blue: 0.4196078431372549, opacity: 1), @@ -404,9 +408,11 @@ extension Theme { textOrange: Color(.sRGB, red: 0.2549019607843137, green: 0.09411764705882353, blue: 0, opacity: 1), textPink: Color(.sRGB, red: 0.36470588235294116, green: 0, blue: 0.21568627450980393, opacity: 1), textPrimary: Color(.sRGB, red: 0.9294117647058824, green: 0.9372549019607843, blue: 0.9882352941176471, opacity: 1), + textPrimaryInverted: Color(.sRGB, red: 0.08627450980392157, green: 0.09411764705882353, blue: 0.16862745098039217, opacity: 1), textPurple: Color(.sRGB, red: 0.16470588235294117, green: 0.06666666666666667, blue: 0.34901960784313724, opacity: 1), textRed: Color(.sRGB, red: 0.3803921568627451, green: 0, blue: 0.08627450980392157, opacity: 1), textSecondary: Color(.sRGB, red: 0.6509803921568628, green: 0.6745098039215687, blue: 0.8392156862745098, opacity: 1), + textSecondaryInverted: Color(.sRGB, red: 0.38823529411764707, green: 0.40784313725490196, blue: 0.5372549019607843, opacity: 1), textSuccess: Color(.sRGB, red: 0.7098039215686275, green: 0.8235294117647058, blue: 0.38823529411764707, opacity: 1), textTeal: Color(.sRGB, red: 0, green: 0.1843137254901961, blue: 0.11764705882352941, opacity: 1), textWarning: Color(.sRGB, red: 0.9529411764705882, green: 0.8196078431372549, blue: 0.4470588235294118, opacity: 1), diff --git a/packages/themes/butter/src/butterPaletteRefs.generated.ts b/packages/themes/butter/src/butterPaletteRefs.generated.ts index e454b9989ceab..203796267512a 100644 --- a/packages/themes/butter/src/butterPaletteRefs.generated.ts +++ b/packages/themes/butter/src/butterPaletteRefs.generated.ts @@ -7,15 +7,15 @@ // prettier-ignore export const butterPaletteRefs = { neutral: { - light: {0: '#000000', 15: '#1d1c11', 30: '#4a4732', 40: '#725538', 45: '#605f52', 55: '#79786a', 70: '#adac9e', 75: '#c7c4b2', 80: '#d6d3b8', 85: '#e5e3d4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'}, - dark: {0: '#000000', 5: '#131107', 10: '#261a13', 15: '#2e2117', 20: '#3a2a1f', 30: '#4a4732', 35: '#49473b', 40: '#725538', 45: '#605f52', 60: '#939184', 70: '#adac9e', 80: '#d6d3b8', 85: '#f0edd4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'}, + light: {0: '#000000', 15: '#1d1c11', 30: '#4a4732', 40: '#725538', 45: '#605f52', 55: '#79786a', 60: '#89877a', 70: '#adac9e', 75: '#c7c4b2', 80: '#d6d3b8', 85: '#e5e3d4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'}, + dark: {0: '#000000', 5: '#131107', 10: '#261a13', 15: '#2e2117', 20: '#3a2a1f', 30: '#4a4732', 35: '#49473b', 40: '#725538', 45: '#605f52', 50: '#6c6c5e', 60: '#939184', 70: '#adac9e', 80: '#d6d3b8', 85: '#f0edd4', 90: '#f3f2e2', 95: '#fdfbe4', 100: '#ffffff'}, }, accent: { light: {35: '#194ce8', 40: '#225bff', 55: '#4d82ff'}, dark: {70: '#81a9ff'}, }, yellow: { - dark: {15: '#2c2600', 25: '#443c00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'}, + dark: {15: '#2c2600', 25: '#443c00', 45: '#796b00', 70: '#bcae4e', 75: '#cdbe59', 85: '#eedf75', 90: '#fdee8c'}, light: {25: '#443c00', 30: '#514700', 55: '#958500', 70: '#bfae35', 80: '#dfcf5b', 85: '#f0df72', 90: '#fdee8c', 95: '#fff7c0'}, }, purple: { diff --git a/packages/themes/butter/src/butterTheme.ts b/packages/themes/butter/src/butterTheme.ts index dea97d3f319fe..12705d38bb54c 100644 --- a/packages/themes/butter/src/butterTheme.ts +++ b/packages/themes/butter/src/butterTheme.ts @@ -377,6 +377,10 @@ export const butterTheme = defineTheme({ '--color-background-card': [neutral.light[100], neutral.dark[20]], '--color-background-popover': [neutral.light[100], neutral.dark[20]], '--color-background-inverted': [neutral.light[15], neutral.dark[95]], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1. + '--color-text-primary-inverted': [neutral.light[100], neutral.dark[15]], + '--color-text-secondary-inverted': [neutral.light[60], neutral.dark[50]], + '--color-text-accent-inverted': [accent.light[55], yellow.dark[45]], // Status semantics share the Red, Yellow, and Green families. '--color-error': [red.light[30], red.dark[85]], diff --git a/packages/themes/gothic/src/gothicTheme.ts b/packages/themes/gothic/src/gothicTheme.ts index 0e7599d5c5bf3..ab34f3251a244 100644 --- a/packages/themes/gothic/src/gothicTheme.ts +++ b/packages/themes/gothic/src/gothicTheme.ts @@ -258,6 +258,11 @@ export const gothicTheme = defineTheme({ '--color-background-card': neutral.dark[15], '--color-background-popover': neutral.dark[20], '--color-background-inverted': neutral.dark[95], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1; + // an accent equal to that surface takes the secondary stop. + '--color-text-primary-inverted': neutral.dark[10], + '--color-text-secondary-inverted': neutral.dark[50], + '--color-text-accent-inverted': neutral.dark[50], '--color-success': green.dark[75], '--color-success-muted': green.dark[75], diff --git a/packages/themes/matcha/src/matchaPaletteRefs.generated.ts b/packages/themes/matcha/src/matchaPaletteRefs.generated.ts index 74ed273d6d62a..b1e615e08968f 100644 --- a/packages/themes/matcha/src/matchaPaletteRefs.generated.ts +++ b/packages/themes/matcha/src/matchaPaletteRefs.generated.ts @@ -7,8 +7,8 @@ // prettier-ignore export const matchaPaletteRefs = { neutral: { - light: {0: '#000000', 20: '#3e481d', 25: '#4c5924', 30: '#5a6b2a', 40: '#707e46', 70: '#b7c29e', 75: '#c0cba9', 85: '#dce3ce', 95: '#f0f0e0', 100: '#ffffff'}, - dark: {0: '#000000', 5: '#12140e', 10: '#1a1c14', 15: '#1e2016', 20: '#3e481d', 30: '#5a6440', 40: '#707e46', 45: '#7a894f', 60: '#94a468', 65: '#92af6a', 70: '#a8bf6a', 75: '#c0cba9', 80: '#cdd8b9', 100: '#ffffff'}, + light: {0: '#000000', 20: '#3e481d', 25: '#4c5924', 30: '#5a6b2a', 40: '#707e46', 65: '#aab58d', 70: '#b7c29e', 75: '#c0cba9', 85: '#dce3ce', 95: '#f0f0e0', 100: '#ffffff'}, + dark: {0: '#000000', 5: '#12140e', 10: '#1a1c14', 15: '#1e2016', 20: '#3e481d', 25: '#4c552e', 30: '#5a6440', 40: '#707e46', 45: '#7a894f', 60: '#94a468', 65: '#92af6a', 70: '#a8bf6a', 75: '#c0cba9', 80: '#cdd8b9', 100: '#ffffff'}, }, teal: { light: {35: '#245546', 50: '#2e6b5a'}, diff --git a/packages/themes/matcha/src/matchaTheme.ts b/packages/themes/matcha/src/matchaTheme.ts index f1d6ae88cb099..7ed4c69e5bd5d 100644 --- a/packages/themes/matcha/src/matchaTheme.ts +++ b/packages/themes/matcha/src/matchaTheme.ts @@ -136,6 +136,11 @@ export const matchaTheme = defineTheme({ '--color-background-card': [neutral.light[100], neutral.dark[15]], '--color-background-popover': [neutral.light[100], neutral.dark[15]], '--color-background-inverted': [neutral.light[20], neutral.dark[75]], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1; + // an accent equal to that surface takes the secondary stop. + '--color-text-primary-inverted': [neutral.light[100], neutral.dark[10]], + '--color-text-secondary-inverted': [neutral.light[65], neutral.dark[25]], + '--color-text-accent-inverted': [neutral.light[65], neutral.dark[25]], // Status / Sentiment '--color-success': [green.light[50], green.dark[70]], diff --git a/packages/themes/stone/src/stonePaletteRefs.generated.ts b/packages/themes/stone/src/stonePaletteRefs.generated.ts index 4b3ef0262dfde..782b188e9a1e7 100644 --- a/packages/themes/stone/src/stonePaletteRefs.generated.ts +++ b/packages/themes/stone/src/stonePaletteRefs.generated.ts @@ -27,8 +27,8 @@ export const stonePaletteRefs = { dark: {25: '#274239', 35: '#3a5b50', 70: '#94b3a9', 90: '#d6e7e1'}, }, neutral: { - light: {0: '#000000', 15: '#25252a', 30: '#46464e', 35: '#525259', 40: '#5f5f64', 55: '#848489', 85: '#d4d3dd', 90: '#e2e2e8', 95: '#f0f0f7', 100: '#ffffff'}, - dark: {0: '#000000', 5: '#101018', 10: '#1b1b21', 15: '#25252a', 20: '#302f36', 25: '#3a3a42', 35: '#525159', 40: '#5e5e64', 65: '#9d9ea5', 70: '#ababb3', 80: '#c6c6cf', 90: '#e2e2e8', 95: '#f0f0f9', 100: '#ffffff'}, + light: {0: '#000000', 15: '#25252a', 30: '#46464e', 35: '#525259', 40: '#5f5f64', 55: '#848489', 60: '#919197', 85: '#d4d3dd', 90: '#e2e2e8', 95: '#f0f0f7', 100: '#ffffff'}, + dark: {0: '#000000', 5: '#101018', 10: '#1b1b21', 15: '#25252a', 20: '#302f36', 25: '#3a3a42', 35: '#525159', 40: '#5e5e64', 45: '#6a6a70', 65: '#9d9ea5', 70: '#ababb3', 80: '#c6c6cf', 90: '#e2e2e8', 95: '#f0f0f9', 100: '#ffffff'}, }, orange: { dark: {25: '#4e3522', 35: '#684c34', 70: '#c9a382', 90: '#ffdcbb'}, diff --git a/packages/themes/stone/src/stoneTheme.ts b/packages/themes/stone/src/stoneTheme.ts index f64066d66d7ac..a5da81bfe1def 100644 --- a/packages/themes/stone/src/stoneTheme.ts +++ b/packages/themes/stone/src/stoneTheme.ts @@ -221,6 +221,11 @@ export const stoneTheme = defineTheme({ '--color-background-card': [neutral.light[100], neutral.dark[15]], '--color-background-popover': [neutral.light[100], neutral.dark[20]], '--color-background-inverted': [neutral.light[15], neutral.dark[95]], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1; + // an accent equal to that surface takes the secondary stop. + '--color-text-primary-inverted': [neutral.light[100], neutral.dark[10]], + '--color-text-secondary-inverted': [neutral.light[60], neutral.dark[45]], + '--color-text-accent-inverted': [neutral.light[60], neutral.dark[45]], // Status / sentiment '--color-success': [green.light[30], green.dark[80]], diff --git a/packages/themes/y2k/src/y2kPaletteRefs.generated.ts b/packages/themes/y2k/src/y2kPaletteRefs.generated.ts index 4e9762e04c7fb..bb8f6b6476981 100644 --- a/packages/themes/y2k/src/y2kPaletteRefs.generated.ts +++ b/packages/themes/y2k/src/y2kPaletteRefs.generated.ts @@ -7,7 +7,7 @@ // prettier-ignore export const y2kPaletteRefs = { neutral: { - light: {15: '#2d241b', 20: '#382e24', 30: '#4f453b', 35: '#5a5146', 40: '#675d52', 75: '#c4b8a9', 80: '#d1c5b8', 85: '#dfd5c9', 90: '#f1e6db', 95: '#fff6ed', 100: '#ffffff'}, + light: {15: '#2d241b', 20: '#382e24', 30: '#4f453b', 35: '#5a5146', 40: '#675d52', 60: '#9a8f82', 75: '#c4b8a9', 80: '#d1c5b8', 85: '#dfd5c9', 90: '#f1e6db', 95: '#fff6ed', 100: '#ffffff'}, dark: {0: '#000000', 5: '#0e0f1a', 10: '#16182b', 15: '#1a1d31', 20: '#1f2238', 25: '#2c3048', 35: '#4a4f6b', 45: '#636889', 70: '#a6acd6', 85: '#d0d4eb', 90: '#dfe2f3', 95: '#edeffc'}, }, purple: { diff --git a/packages/themes/y2k/src/y2kTheme.ts b/packages/themes/y2k/src/y2kTheme.ts index a795ea2d10c7b..8c1ad54a66d94 100644 --- a/packages/themes/y2k/src/y2kTheme.ts +++ b/packages/themes/y2k/src/y2kTheme.ts @@ -362,6 +362,11 @@ export const y2kTheme = defineTheme({ '--color-background-card': [neutral.light[100], neutral.dark[10]], '--color-background-popover': [neutral.light[100], neutral.dark[20]], '--color-background-inverted': [neutral.light[15], neutral.dark[95]], + // Text on the inverted surface (a tooltip), on named stops at 4.5:1; + // an accent equal to that surface takes the secondary stop. + '--color-text-primary-inverted': [neutral.light[100], neutral.dark[10]], + '--color-text-secondary-inverted': [neutral.light[60], neutral.dark[45]], + '--color-text-accent-inverted': [neutral.light[60], neutral.dark[45]], // Status / sentiment '--color-success': [green.light[80], green.dark[80]],