-
Notifications
You must be signed in to change notification settings - Fork 19
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
Stylelint config #45
Stylelint config #45
Conversation
2bfebe8
to
16b59ce
Compare
This LGTM. @kucrut it'd be good to get your thoughts on this too, for standards we're looking to meet see the PR on the engineering repo. |
Looks good to me 👍 |
I've tested this on a client's setup and it works as expected. I'll need to update the instructions in the Engineering repo (update: done), but I think that this is ready for a final review. |
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.
Looks good to me 👍
Blocked on https://github.com/humanmade/Engineering/pull/85 @mikeselander So that we can publish this as a standalone rule on npm, can you put the package.json rules and config into a |
Adds a rule for `at-rule-empty-line-before` similar to the `rule-empty-line-before` settings.
Removing this requirement as it conflicts with editors that remove trailing whitespace (and is a bit silly).
I'm using this on a client's site refresh to iron out a few inconsistencies and odd rules. Still a little work to do before it can be merged. |
I haven't got time to dig into it right now but the following throws a bunch of errors: background-image:
linear-gradient(
to bottom,
#000 50%,
transparent 50%
);
|
@peterwilsoncc looks like we can change those lines from Note (for self): https://stylelint.io/user-guide/rules/function-parentheses-space-inside/ As I think about it, we also need a reliable way to test these rules out so maybe I'll give that a think as well. |
…or more flexibility in multiple-line style declarations
@peterwilsoncc I modified the configuration file for both of the mentioned rules, could you test it out against that syntax? Note: I moved the config into a sub-folder as requested by Ryan. |
Excludes first-nestted and stylelint comments from the empty line before comments rule.
Change in c12ca5c allows for comments at the top of blocks to avoid empty lines. @mikeselander @sambulance the WP rules require numeric font-weights. As this is something CSS{nano|min} can handle, I'm tempted to remove the rule. |
@peterwilsoncc Wouldn't we want consistency across the source rather than the compiled CSS? |
@sambulance yeah, I meant reverse rather than remove so the rule would become:
|
👍 Do you know why WP prefers numeric values? I thought it was better to use named values so the browser can choose the correct font-weight based on what is available, rather than having to faux it (eg if a 600 weight semibold is loaded, use that as |
No idea why core prefers numeric weight values 🤷🏻♂️, there's no reason giving in their standards so I'll see if @ntwb knows the archeology. |
I personally quite like the explicitness of numbered font weights, I find it a nuisance to look up which named font size equates to which one I want but the numbered variants translate consistently and more explicitly. This is just personal preference though. If there's some benefit that I don't know about I'm happy to be schooled :D |
As another note on this, the valid values in stylelint don't look they cover enough values - Since I haven't used named values in quite a while (particularly with stylelint) what's the preferred way of getting around this? |
@mikeselander This is due to that @peterwilsoncc @sambulance When discussing this with Peter the other day I couldn't recall the background on why switching to numerical fonts was made, and today, huzzah I've found it: https://core.trac.wordpress.org/changeset/37740. Further background can be read in the long read ticket WP#36753 |
Thanks @ntwb that's really interesting. Seems the switch to system fonts haas found flaws with the exact reasoning I used above, but only because of the inconsistency of how the font weight is declared. I think the bottom line is, as long as we stick to one naming convention, we should be fine. And given that |
I've edited the original description to add some todos before we deploy this addressing some of the comments above and in humanmade/Engineering#85 |
@peterwilsoncc @rmccue how are you guys feeling about this PR? peter, do you mind expanding on the checklist that you added in the main comment? |
@mikeselander There are a few changes I have in Bounce that I'd like to push up next week. Re todos:
|
@peterwilsoncc @rmccue How would you feel about us merging this now and then adding Wilson's changes in a follow-up PR? This has been sitting for over 5 months and at some point something should be better than nothing. |
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.
@mikeselander Fine by me. Long-term, do you want to own package maintenance for this? 😬
I'm happy to write some tests for this once merged. This repo also needs https://lernajs.io added. |
Yes, I'm happy to own maintenance on this.
That would be amazing Stephen! |
Indeed, we'll need to ensure package versions and tags are coordinated across all of these (so we'll need to immediately bump the version way up). I'll leave this for a final approval for @peterwilsoncc, feel free to merge if you approve. |
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 happy if this goes in.
Adding a stylelint configuration to match the new CSS standards.
Edit by @peterwilsoncc:
TODO:
Switch font weights tonamed-where-possible