-
Notifications
You must be signed in to change notification settings - Fork 383
Ensure that user provided SCSS has precedence over quarto generated scss also for Dark theme #10822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
226043e
Ensure that user provided SCSS has precedent over quarto generated sc…
cderv 8c37079
Add some playwright test for background color in light / dark mode sw…
cderv db4cd2c
fix locator
cderv 1258bbd
Upload playwright report as artifact in Github workflow
cderv 54ea27e
Run playwright testing really as part of Deno test
cderv 02b42ec
Correctly print the message in github action when playwright tests fails
cderv c3de54b
Explicitly ignore test on Windows
cderv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/docs/playwright/html/dark-light-theme-custom/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*_files/ | ||
*.html |
8 changes: 8 additions & 0 deletions
8
tests/docs/playwright/html/dark-light-theme-custom/custom.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/*-- scss:defaults --*/ | ||
|
||
/*-- scss:rules --*/ | ||
.quarto-title-banner { | ||
margin-bottom: 1em; | ||
color: #dee2e6; | ||
background: red; | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/docs/playwright/html/dark-light-theme-custom/index.qmd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: "Quarto Playground" | ||
title-block-banner: true | ||
format: | ||
html: | ||
theme: | ||
light: | ||
- cosmo | ||
- custom.scss | ||
dark: | ||
- darkly | ||
- custom.scss | ||
--- | ||
|
||
This is a playground for Quarto. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('Dark and light theme respect user themes', async ({ page }) => { | ||
// This document use a custom theme file that change the background color of the title banner | ||
// Same user defined color should be used in both dark and light theme | ||
await page.goto('./html/dark-light-theme-custom/'); | ||
const locatr = await page.locator('div').filter({ hasText: 'Quarto Playground' }).first() | ||
await expect(locatr).toHaveCSS('background-color', 'rgb(255, 0, 0)'); | ||
await page.locator("a.quarto-color-scheme-toggle").click(); | ||
const locatr2 = await page.locator('div').filter({ hasText: 'Quarto Playground' }).first() | ||
await expect(locatr2).toHaveCSS('background-color', 'rgb(255, 0, 0)'); | ||
}); | ||
|
||
test('Dark theming toggle change to dark background ', async ({ page }) => { | ||
await page.goto('./html/dark-light-theme-custom/'); | ||
const locatr = page.getByText('Quarto Playground This is a'); | ||
await expect(locatr).toHaveCSS('background-color', 'rgb(255, 255, 255)'); | ||
// switching to dark theme using toggle | ||
await page.locator("a.quarto-color-scheme-toggle").click(); | ||
const locatr2 = await page.locator('div').filter({ hasText: 'Quarto Playground' }).first() | ||
await expect(locatr2).toHaveCSS('background-color', 'rgb(255, 0, 0)'); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.