Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Compiled css vs scss - different rem units precision #3030

Closed
sdurnov opened this issue Jan 13, 2019 · 7 comments · Fixed by #3086
Closed

Compiled css vs scss - different rem units precision #3030

sdurnov opened this issue Jan 13, 2019 · 7 comments · Fixed by #3086
Assignees

Comments

@sdurnov
Copy link

sdurnov commented Jan 13, 2019

Describe the bug

When Clarity styles are being compiled from scss during build process, rems are much more precise than when compiled css are used. That leads to some rendering differences. For instance, text and dismiss button in alerts is shifted 1px vertically for pre-compiled css.

How to reproduce

PrntScreen closable alert from Clarity website and compare it to Clarity Light Theme Blitz with same alert example code put into it. You'll see 1px difference in vertical position of text and dismiss button.
Then go into browser dev tools, select close button in both cases and see that Clarity website code shows more decimal digits for rem units than compiled css example.

Expected behavior

Both scss and comiled css styles shoud have identical precision

@sdurnov
Copy link
Author

sdurnov commented Jan 13, 2019

Clarity Website https://clarity.design/documentation/alerts
image

Light theme Blitz, where I just pasted code from website example
image

Check out how precision is different for margins

@sdurnov
Copy link
Author

sdurnov commented Jan 13, 2019

Looks like this is not css vs scss, maybe this is related particularly to your site build process

@gnomeontherun
Copy link
Contributor

Thanks for bringing this up, I'll review it but yes we do change the default precision in our build of @clr/ui, and the new website doesn't appear to have that same setting turned on. Should be a simple fix but will need to look closer to verify.

@sdurnov
Copy link
Author

sdurnov commented Jan 14, 2019

@gnomeontherun if understood you correctly, you'll increase css/scss precision for Clarity sources, rather than decreasing it for a website? It would be awesome.

@gnomeontherun
Copy link
Contributor

I have to check, but what we need to do is ensure they are the same precision so the website builds the sass files the same way.

@gnomeontherun
Copy link
Contributor

So I'm not seeing a real world difference between a stackblitz demo of the card alert rendering and the website example. There are 2 decimal places more precision in the website build than the official Clarity build. However more precision is alright and we can standardize at 8 I believe.

gnomeontherun added a commit to gnomeontherun/clarity that referenced this issue Jan 30, 2019
* change precision of SASS build to match Angular CLI
* fix basic select text which talked about inputs
* remove link to old grid in grid docs
* remove success app-level alert in docs

closes vmware-archive#3074
closes vmware-archive#3071
closes vmware-archive#3070
closes vmware-archive#3030

Signed-off-by: Jeremy Wilken <[email protected]>
gnomeontherun added a commit that referenced this issue Feb 5, 2019
* change precision of SASS build to match Angular CLI
* fix basic select text which talked about inputs
* remove link to old grid in grid docs
* remove success app-level alert in docs

closes #3074
closes #3071
closes #3070
closes #3030

Signed-off-by: Jeremy Wilken <[email protected]>
@github-actions
Copy link

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants