-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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(react-slider): Export internal CSS vars #33682
base: master
Are you sure you want to change the base?
fix(react-slider): Export internal CSS vars #33682
Conversation
@@ -0,0 +1,7 @@ | |||
{ |
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.
🕵🏾♀️ visual regressions to review in the fluentuiv9 Visual Regression Report
Avatar Converged 1 screenshots
Image Name | Diff(in Pixels) | Image Type |
---|---|---|
Avatar Converged.badgeMask.chromium.png | 3 | Changed |
Drawer 1 screenshots
Image Name | Diff(in Pixels) | Image Type |
---|---|---|
Drawer.Full Overlay RTL.chromium.png | 1168 | Changed |
📊 Bundle size reportUnchanged fixtures
|
Pull request demo site: URL |
}; | ||
|
||
const { sliderDirectionVar, sliderStepsPercentVar, sliderProgressVar } = sliderCSSVars; |
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.
deconstructing all the vars out here saves a bunch of code below. 61 vars with sliderCSSVars prefix. sliderCSSVars.sliderThumbSizeVar
could simply be sliderThumbSizeVar
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.
I added it this way because of this comment:
#32939 (comment)
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.
If there is good reason to remove the destructuring, that's fine.
yeah, this works fine. my only last suggestion would be to write a story about customizing, which would also validate the work. |
aeb4e15
to
df41a58
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.
We might not want to expose all internal variables. For instance, sliderThumbPositionVar
is a computed value derived from progressVar
, so modifying it independently might not be logical.
However, I agree that color and size variables could be safely exposed.
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.
just to double check to make sure we are not breaking our public API contract.
can you confirm that these vars were supposed to be exposed since release ? and this is just fix to previous assumption ?
we should be very careful about exposing internal things ( they are called internal for some reason )
ty
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.
i'm fine without the desctructuring if we find that its better for compilers.
Partner's ask. Discussed it with @micahgodbolt
Previous Behavior
CSS variables were internal
New Behavior
Exported those variables
Added story with an example
Fixes [Bug]: internal CSS variables aren't exported for Slider component #33668