-
Notifications
You must be signed in to change notification settings - Fork 201
fix(progressbar): revert background-color to background #2929
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
fix(progressbar): revert background-color to background #2929
Conversation
🦋 Changeset detectedLatest commit: bafdfd0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Deployed on https://pr-2929--spectrum-css.netlify.app |
File metricsSummaryTotal size: 4.63 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
Detailsprogressbar
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
76c8a89
to
7419b0c
Compare
trackFill: "linear-gradient(to right, hotpink, orange)", | ||
progressBarFill: "linear-gradient(to left, teal, purple)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have "standardized" gradients or anything that I could use here instead? I saw on the spectrum-two
branch that there's a specified gradient for staticWhite
/staticBlack
stories (https://github.com/adobe/spectrum-css/pull/2637/files), but I couldn't find anything like that in main
.
d904656
to
b6061d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While walking through the validation steps and adding --mod
overrides to Progress Bar and Meter, all of the variants displayed as you described they should!
But, when I got to the static white
variants, it didn't seem like those examples were displaying correctly.
This screenshot shows the above --mod
s when visiting static white
without any additional adjustments. It sounds like static white
should disallow gradients, yes? Let me know if I got that wrong or if my testing was faulty!

b6061d3
to
ace1ea8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. I'm good with the CSS and what I'm seeing in Storybook. Just two minor suggestions.
2e0b63c
to
08c74d9
Compare
@@ -1,5 +1,5 @@ | |||
import { Variants } from "@spectrum-css/preview/decorators"; | |||
import { Template } from "./template.js"; | |||
import { Template } from "./meter.template.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pfulton - I know this encroaches on a bug card we had talked about in slack. Let me know if you'd rather me drop this.
this removes the previously created mod property that could override the staticWhite background-color, which is in contradiction to how the CSS should behave.
- also uses existing map function to display gradient story
Co-authored-by: [ Cassondra ] <castastrophe@users.noreply.github.com>
instead of setting the full mod custom property within customStyles (i.e. customStyles: {"--mod-progressbar-fill-color": "linear-gradient(to left, teal, purple)"}), revert back to separate arguments (i.e. trackFill and progressBarFill). This way we can update naming or the format in one place
08c74d9
to
bafdfd0
Compare
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
Description
For certain use cases in Express, a linear-gradient is needed within the progress bar for the fill color. According to the slack conversation, the team previously achieved this by setting the
--mod-progressbar-fill-color
to override--spectrum-progressbar-fill-color
. With a change from background (which supported linear-gradients) to background-color (which does not), Express can no longer override the fill color (release and initial PR).This PR should revert the background-color properties to background, and creates a Chromatic-only test for both
meter
andprogressbar
. Thetrack-color
,fill-color
, and corresponding staticWhite mod values can all be a linear-gradients (as well as other values like radial-gradients or images) now.CSS-848
Screenshots
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Progress bar
progressbar/index.css
, forspectrum-ProgressBar-fill
andspectrum-ProgressBar-track
, create custom mod properties that test linear-gradients such as:--mod-progressbar-fill-color: linear-gradient(to right, teal, purple);
--mod-progressbar-track-color: linear-gradient(to right, hotpink, orange);
background
(for eitherspectrum-ProgressBar-fill
orspectrum-ProgressBar-track
) back tobackground-color
in the CSS, the stories should break when gradient values are resolved.Meter
fill-color
andtrack-color
mod properties you just created inprogressbar/index.css
.is-positive.spectrum-ProgressBar-fill
/.is-negative .spectrum-ProgressBar-fill
/.is-notice .spectrum-ProgressBar-fill
fills formeter
:--mod-progressbar-fill-color-positive: linear-gradient(to left, hotpink, orange);
--mod-progressbar-fill-color-negative: linear-gradient(to left, teal, purple);
--mod-progressbar-fill-color-notice: linear-gradient(to left, teal, purple);
spectrum-ProgressBar-track
and set that track mod property. It should work as before.background
back tobackground-color
in the CSS, the stories should break when gradient values are present.Both components
staticWhite
variant. No modifications/gradients should be seen, and no variants should have your current mod valuesstaticColor
fills (it should no longer have a gradient)staticColor
variant for.spectrum-ProgressBar-fill
:--mod-progressbar-fill-color-white: linear-gradient(to right, hotpink, orange)
; (this is current behavior)#### Additional ValidationIf you choose, you could also turn on the trackFill and progressBarFill controls that are hidden.- [ ] Inprogressbar.stories.js
, replace thetrackFill
andprogressBarFill
object with the following:- [ ] This should allow you to select the color from the color section to verify those values are getting passed to the mod properties. You can also type in the field and test your own gradients from the controls.Regression testing
Validate:
Screenshots
To-do list