Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
276 stars 75 forks source link

Same instances of calcite slider appear to have different rendered size #8049

Open minhiu opened 9 months ago

minhiu commented 9 months ago

Check existing issues

Actual Behavior

I have multiple same instances of Calcite Slider element, however, they appear to be different in block-size: Screen Shot 2023-10-24 at 12 46 15 PM

As we can see, the two sliders highlighted in red boxes appear to be slightly smaller, even though all sliders are the same instances of Calcite Slider.

Expected Behavior

All sliders should appear to have the same size

Reproduction Sample

https://codepen.io/Hieu-Pham-the-animator/pen/Jjxdjma?editors=1000

Reproduction Steps

Changing the browser's zoom level will also change the rendered size of the sliders randomly.

Reproduction Version

1.9.2

Relevant Info

No response

Regression?

No response

Priority impact

p4 - not time sensitive

Impact

No response

Calcite package

Esri team

ArcGIS Business/Community Analyst

jcfranco commented 8 months ago

Thanks for reporting this.

I believe this is expected since we're using rems to size the slider track (as well as other parts). Due to how rems are calculated, it is expected that some calculated values might be fractional and depending on user's hardware, this might cause some differences in rendering (FWIW, this isn't observable in Retina displays).

geospatialem commented 8 months ago

Will revisit once the token effort is completed in https://github.com/Esri/calcite-design-system/issues/7180, targeted for next month (December).

jcfranco commented 8 months ago

Adding to @geospatialem's comment, component tokens will use pixels (vs rems as the slider currently does), so multiple component instances would render consistently. cc @alisonailea