Skip to content
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

pxToRem-settings #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

pxToRem-settings #157

wants to merge 1 commit into from

Conversation

artreaktor-niks
Copy link
Collaborator

@artreaktor-niks artreaktor-niks commented Apr 26, 2022

Upd.
After discussions and Drupal best practices: we are going to convert into rem all.
Some cases where need to be used line in 1px - it should be done by border.

====
Setted ignore list of styles, like border etc.
Proposition for minimum px to covert = starts from 3px.
It minimizes adding everywhere exclusion for the linter and for the calculation of the CSS.

Proposition to disable unit case check and linter fix.
inside file ".stylelintrc"
add "unit-case": null,

"unit-case": null,
"unit-allowed-list": ["deg", "em", "ex", ... ]

Also, to minimize linter exclusion of unit-case in the code.

I don't think that converting 1px or even 2px sometimes is a good idea, also add every time exclusion for the border: 1px;
We can disable this globally.
Where we need this in rem's - we can convert it manually.

'!filter',
'!border',
'!border-width',
'!border-top-width',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort the list alphabetically

@@ -27,9 +27,30 @@ module.exports = () => ({
}),
postcssDiscardEmpty(),
pxtorem({
minPixelValue: 3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure all these changes are useful..
usually we use rems scaling. See example: on 1440px design you have border with 2px width. But what you will show on retina 5120px resolution? Your 2px will look tiny. That's why everything should be converted to rems

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the CSS which is really required to be in pixel, you can use the following code:

.selector {
  /* stylelint-disable-next-line unit-case */
  width: 2PX;
}

In that case it will not be automatically converted to rems

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would better set fixed base font size after 1920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants