-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(progress-bar): add styling for the ionic theme #30185
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
Changes from 3 commits
e5b00af
79d5e31
2d5aa94
09bfdc0
632456b
32dc863
1707011
24c17fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| @use "../../themes/ionic/ionic.globals.scss" as globals; | ||
| @use "./progress-bar"; | ||
|
|
||
| // Ionic Progress bar | ||
| // -------------------------------------------------- | ||
|
|
||
| :host { | ||
| --background: #{globals.$ion-primitives-neutral-100}; | ||
|
|
||
| height: globals.$ion-scale-100; | ||
| } | ||
|
|
||
| // Progress Bar Shapes | ||
| // ------------------------------------------------------------------------------- | ||
|
|
||
| :host(.progress-bar-shape-round) { | ||
| @include globals.border-radius(globals.$ion-border-radius-full); | ||
| } | ||
|
|
||
| :host(.progress-bar-shape-rectangular) { | ||
| @include globals.border-radius(globals.$ion-border-radius-0); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en" dir="ltr"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <title>Progress Bar - Shape</title> | ||
| <meta | ||
| name="viewport" | ||
| content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" | ||
| /> | ||
| <link href="../../../../../css/ionic.bundle.css" rel="stylesheet" /> | ||
| <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" /> | ||
| <script src="../../../../../scripts/testing/scripts.js"></script> | ||
| <script nomodule src="../../../../../dist/ionic/ionic.js"></script> | ||
| <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> | ||
|
|
||
| <style> | ||
| ion-content::part(scroll) { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| } | ||
thetaPC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ion-progress-bar { | ||
| margin: 10px 0; | ||
thetaPC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| width: 70%; | ||
thetaPC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-header> | ||
| <ion-toolbar> | ||
| <ion-title>Progress Bar - Shape</ion-title> | ||
| </ion-toolbar> | ||
| </ion-header> | ||
|
|
||
| <ion-content class="ion-padding"> | ||
| <ion-label> Default </ion-label> | ||
thetaPC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <ion-progress-bar value="0.50"></ion-progress-bar> | ||
|
|
||
| <ion-label> Round </ion-label> | ||
| <ion-progress-bar value="0.50" shape="round"></ion-progress-bar> | ||
|
|
||
| <ion-label> Rectangular </ion-label> | ||
| <ion-progress-bar value="0.50" shape="rectangular"></ion-progress-bar> | ||
| </ion-content> | ||
| </ion-app> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import { configs, test } from '@utils/test/playwright'; | ||
|
|
||
| configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('progress-bar: shape'), () => { | ||
| test('round - should not have visual regressions', async ({ page }) => { | ||
| await page.setContent( | ||
| ` | ||
| <style> | ||
| :root { | ||
| background: #ccc7c7; | ||
thetaPC marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| .container { | ||
| padding: 10px; | ||
| } | ||
| </style> | ||
|
|
||
| <div class="container"> | ||
| <ion-progress-bar value="0.50" shape="round"></ion-progress-bar> | ||
| </div> | ||
| `, | ||
| config | ||
| ); | ||
|
|
||
| const container = page.locator('.container'); | ||
|
|
||
| await expect(container).toHaveScreenshot(screenshot(`progress-bar-shape-round`)); | ||
| }); | ||
|
|
||
| test('rectangular - should not have visual regressions', async ({ page }) => { | ||
| await page.setContent( | ||
| ` | ||
| <style> | ||
| :root { | ||
| background: #ccc7c7; | ||
| } | ||
|
|
||
| .container { | ||
| padding: 10px; | ||
| } | ||
| </style> | ||
|
|
||
| <div class="container"> | ||
| <ion-progress-bar value="0.50" shape="rectangular"></ion-progress-bar> | ||
| </div> | ||
| `, | ||
| config | ||
| ); | ||
|
|
||
| const container = page.locator('.container'); | ||
|
|
||
| await expect(container).toHaveScreenshot(screenshot(`progress-bar-shape-rectangular`)); | ||
| }); | ||
| }); | ||
| }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete the shape snapshots and re-generate them. Playwright isn't able to detect the background change to buffer. That's why we need to force a re-generation. Background shouldn't be white, but neutral 100.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have regenerated the screenshots but no changes were made in the regeneration. I think the bar background looks white in comparison with |
Uh oh!
There was an error while loading. Please reload this page.