diff --git a/.changeset/flat-bags-remain.md b/.changeset/flat-bags-remain.md new file mode 100644 index 0000000000..36f58ce4e6 --- /dev/null +++ b/.changeset/flat-bags-remain.md @@ -0,0 +1,5 @@ +--- +"@primer/view-components": patch +--- + +Remove old primitives color themes imports and only use V8 on the demo lookbook diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/scheme_default/default.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/scheme_default/default.png index cf4f63e95c..adf2c1ec8a 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/scheme_default/default.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/scheme_default/default.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/scheme_default/focused.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/scheme_default/focused.png index 3f51acdf2a..7020ec8e29 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/scheme_default/focused.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/scheme_default/focused.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/sizes_default/default.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/sizes_default/default.png index cf4f63e95c..adf2c1ec8a 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/sizes_default/default.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/sizes_default/default.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/sizes_default/focused.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/sizes_default/focused.png index 3f51acdf2a..7020ec8e29 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/sizes_default/focused.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/button_marketing/sizes_default/focused.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/checked/default.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/checked/default.png index 77dd72b921..6bbcdab9f7 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/checked/default.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/checked/default.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/checked/focused.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/checked/focused.png index b04145f6f3..fef8aaa253 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/checked/focused.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/checked/focused.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/default/default.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/default/default.png index 1ff9d1cf09..aec94eb0a4 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/default/default.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/default/default.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/default/focused.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/default/focused.png index 82a759b359..41e6412914 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/default/focused.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/default/focused.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/small/default.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/small/default.png index b387c7bf84..6ab501b901 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/small/default.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/small/default.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/small/focused.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/small/focused.png index 0efc2f4fd1..dc44ef257e 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/small/focused.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/small/focused.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_a_bad_src/default.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_a_bad_src/default.png index 1ff9d1cf09..aec94eb0a4 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_a_bad_src/default.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_a_bad_src/default.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_a_bad_src/focused.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_a_bad_src/focused.png index 82a759b359..41e6412914 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_a_bad_src/focused.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_a_bad_src/focused.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_status_label_position_end/default.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_status_label_position_end/default.png index 54a972a25d..8136ed25de 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_status_label_position_end/default.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_status_label_position_end/default.png differ diff --git a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_status_label_position_end/focused.png b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_status_label_position_end/focused.png index 28c4a03fd9..e437f377ed 100644 Binary files a/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_status_label_position_end/focused.png and b/.playwright/screenshots/snapshots.test.ts-snapshots/primer/alpha/toggle_switch/with_status_label_position_end/focused.png differ diff --git a/demo/app/assets/stylesheets/application.css b/demo/app/assets/stylesheets/application.css index c4be71a0d5..92ba18adf3 100644 --- a/demo/app/assets/stylesheets/application.css +++ b/demo/app/assets/stylesheets/application.css @@ -10,10 +10,64 @@ *= require @primer/primitives/tokens-next-private/css/functional/size/size.css *= require @primer/primitives/tokens-next-private/css/functional/size/viewport.css *= require @primer/primitives/tokens-next-private/css/functional/typography/typography.css - *= require @primer/css/dist/color-modes.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/dark-colorblind.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/dark-dimmed.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/dark-high-contrast.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/dark-tritanopia.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/dark.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/light-colorblind.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/light-high-contrast.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/light-tritanopia.css + *= require @primer/primitives/tokens-next-private/css/functional/themes/light.css *= require @primer/css/dist/base.css *= require @primer/css/dist/buttons.css *= require @primer/css/dist/layout.css *= require @primer/css/dist/utilities.css *= require @primer/css/dist/markdown.css */ + +:root,[data-color-mode="light"][data-light-theme*="light"],[data-color-mode="dark"][data-dark-theme*="light"] { + color-scheme: light +} + +@media(prefers-color-scheme: light) { + [data-color-mode="auto"][data-light-theme*="light"] { + color-scheme:light + } +} + +@media(prefers-color-scheme: dark) { + [data-color-mode="auto"][data-dark-theme*="light"] { + color-scheme:light + } +} + +[data-color-mode="light"][data-light-theme*="dark"],[data-color-mode="dark"][data-dark-theme*="dark"] { + color-scheme: dark +} + +@media(prefers-color-scheme: light) { + [data-color-mode="auto"][data-light-theme*="dark"] { + color-scheme:dark + } +} + +@media(prefers-color-scheme: dark) { + [data-color-mode="auto"][data-dark-theme*="dark"] { + color-scheme:dark + } +} + +[data-color-mode] { + color: var(--fgColor-default, var(--color-fg-default)); + background-color: var(--bgColor-default, var(--color-canvas-default)) +} + +@media(forced-colors: active) { + body { + --color-accent-emphasis: Highlight; + --color-fg-on-emphasis: LinkText; + --fgColor-onEmphasis: LinkText; + --fgColor-accent: Highlight + } +} diff --git a/demo/app/assets/stylesheets/component_preview.css b/demo/app/assets/stylesheets/component_preview.css index 5d388aee38..5df6447d88 100644 --- a/demo/app/assets/stylesheets/component_preview.css +++ b/demo/app/assets/stylesheets/component_preview.css @@ -32,7 +32,7 @@ position: absolute; bottom: 0; right: 0; - background-color: var(--color-canvas-subtle); + background-color: var(--bgColor-muted); padding: var(--base-size-4) var(--base-size-8); font: var(--primer-text-caption-shorthand); } diff --git a/demo/app/assets/stylesheets/primitives_v8.css b/demo/app/assets/stylesheets/primitives_v8.css deleted file mode 100644 index aa6c70524d..0000000000 --- a/demo/app/assets/stylesheets/primitives_v8.css +++ /dev/null @@ -1,11 +0,0 @@ -/* - *= require @primer/primitives/tokens-next-private/css/functional/themes/dark-colorblind.css - *= require @primer/primitives/tokens-next-private/css/functional/themes/dark-dimmed.css - *= require @primer/primitives/tokens-next-private/css/functional/themes/dark-high-contrast.css - *= require @primer/primitives/tokens-next-private/css/functional/themes/dark-tritanopia.css - *= require @primer/primitives/tokens-next-private/css/functional/themes/dark.css - *= require @primer/primitives/tokens-next-private/css/functional/themes/light-colorblind.css - *= require @primer/primitives/tokens-next-private/css/functional/themes/light-high-contrast.css - *= require @primer/primitives/tokens-next-private/css/functional/themes/light-tritanopia.css - *= require @primer/primitives/tokens-next-private/css/functional/themes/light.css -*/ diff --git a/demo/app/views/layouts/component_preview.html.erb b/demo/app/views/layouts/component_preview.html.erb index 06588dc2d4..2ca4b37138 100644 --- a/demo/app/views/layouts/component_preview.html.erb +++ b/demo/app/views/layouts/component_preview.html.erb @@ -6,9 +6,6 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> - <% if params.dig(:primitives) || params.dig(:lookbook, :display, :primitives) == "next_major_v8" %> - <%= stylesheet_link_tag "primitives_v8", "data-turbo-track": "reload" %> - <% end %> <%= stylesheet_link_tag "primer_view_components", "data-turbo-track": "reload" %> <%= javascript_include_tag "primer_view_components", type: "module", "data-turbo-track": "reload" %> <% if Rails.env.development? %> diff --git a/demo/config/application.rb b/demo/config/application.rb index 90bfaf8bb1..18aa0a92e8 100644 --- a/demo/config/application.rb +++ b/demo/config/application.rb @@ -90,10 +90,6 @@ class Application < Rails::Application ["Dark high contrast", "dark_high_contrast"], ["Dark colorblind", "dark_colorblind"], ["All themes", "all"] - ], - primitives: [ - ["Next Major v8", "next_major_v8"], - ["Default", "default"] ] } diff --git a/test/playwright/snapshots.test.ts b/test/playwright/snapshots.test.ts index a231d5c025..63ca3f370d 100644 --- a/test/playwright/snapshots.test.ts +++ b/test/playwright/snapshots.test.ts @@ -32,7 +32,7 @@ test.describe('generate snapshots', () => { if (example.snapshot === 'interactive') { for (const theme of themes) { test(`${example.preview_path}-${theme}`, async ({page}) => { - await page.goto(`/rails/view_components/${example.preview_path}?theme=${theme}&primitives=next_major_v8`) + await page.goto(`/rails/view_components/${example.preview_path}?theme=${theme}`) // Focus state await page.keyboard.press('Tab') @@ -50,7 +50,7 @@ test.describe('generate snapshots', () => { } test(example.preview_path, async ({page}) => { - await page.goto(`/rails/view_components/${example.preview_path}?theme=all&primitives=next_major_v8`) + await page.goto(`/rails/view_components/${example.preview_path}?theme=all`) const defaultScreenshot = await page.locator('#component-preview').screenshot({animations: 'disabled'}) expect(defaultScreenshot).toMatchSnapshot([example.preview_path, 'default.png'])