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

Order of Display property in CSS Linter #93

Open
eldelentes opened this issue Jul 9, 2018 · 6 comments
Open

Order of Display property in CSS Linter #93

eldelentes opened this issue Jul 9, 2018 · 6 comments

Comments

@eldelentes
Copy link

One of the reasons for the new properties sorting in our stylesheets it's to have a better semantics of the code.

Although with the SMACSS sorting we have a better ordering I think that the displayproperty might place it before the position property because if not the outcome it's a little weird having in mind the closeness of the display: flex property and align-items property for example.

So instead of having:

...
"display",
"visibility",
"position",
"z-index",
 "top",
"right",
"bottom",
 "left",
"box-sizing",
"grid",
"grid-after",
 "grid-area",
...

I propose this:

...
"visibility",
"position",
"z-index",
 "top",
"right",
"bottom",
 "left",
"box-sizing",
"display",
"grid",
"grid-after",
 "grid-area",
...

Let me know what you thing about this.

@kurenn
Copy link
Member

kurenn commented Jul 11, 2018

Sounds good! makes sense to me, could you be so kind and place a PR with this change on the scss-lint we use. You can find the latest version in here -
https://github.com/IcaliaLabs/guides/blob/master/best_practices/code-analysis/.scss-lint.yml

@vovimayhem
Copy link
Contributor

Treating "box" as "display" and "position" feels like an oversight to me.

What about MDO's property grouping? :

  1. Positioning
  2. Box model
  3. Typographic
  4. Visual

@eldelentes
Copy link
Author

@vovimayhem I understand that and I think its a good point, but for example how we consider align-items: center; as a Positioning? or as a Box Model (Because of Display Flex)

@kurenn
Copy link
Member

kurenn commented Jul 23, 2018

I would say for box model, we can customize the linting order, how does the other designers feel about this?

@vovimayhem
Copy link
Contributor

vovimayhem commented Jul 24, 2018

@eldelentes @kurenn The align-items property is being discussed on a W3C draft called "Box Alignment Module Level 3"... so it looks like it's being considered in the Box model.

@kurenn
Copy link
Member

kurenn commented Jul 24, 2018

Master @vovimayhem ! Let's make it box model then, or what do you think @eldelentes ?

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

No branches or pull requests

4 participants