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

docs(style): add scss section to style guide #5043

Merged

Conversation

joshblack
Copy link
Contributor

Add in a section for scss guidelines and style conventions to our style guide.

Changelog

New

Changed

  • The style guide has been updated to include a section for styles

Removed

Testing / Reviewing

  • Read through the style guide and let me know if it makes sense!

@joshblack joshblack requested a review from a team as a code owner January 15, 2020 00:21
@joshblack joshblack requested review from asudoh and aledavila January 15, 2020 00:21
@joshblack
Copy link
Contributor Author

cc @jendowns if you have any feedback too!


// Later on in the file
.component {
&:focus {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I really don't have a problem with not nesting selectors, my main gripe is just having inconsistent styling throughout the repo. Unnesting all selectors should be part of a major refactor if searchability is the main concern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tw15egan 100% agreed!

@netlify
Copy link

netlify bot commented Jan 15, 2020

Deploy preview for carbon-components-react failed.

Built with commit bf78ad7

https://app.netlify.com/sites/carbon-components-react/deploys/5e20ee02f698ef000921fe0a

@netlify
Copy link

netlify bot commented Jan 15, 2020

Deploy preview for carbon-elements ready!

Built with commit bf78ad7

https://deploy-preview-5043--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Jan 15, 2020

Deploy preview for the-carbon-components ready!

Built with commit bf78ad7

https://deploy-preview-5043--the-carbon-components.netlify.com

docs/style.md Outdated Show resolved Hide resolved
Co-Authored-By: Abbey Hart <[email protected]>
Copy link
Contributor

@jendowns jendowns left a comment

Choose a reason for hiding this comment

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

Thanks @joshblack this looks great! I had a couple small comments throughout, plus the following questions:

1. Did you want to talk at all about shorthand rules?

  • Is it preferable, as is the case with padding / margin shorthand?
  • What are the perils? (Thinking specifically how Safari does not support the two-value overflow shorthand & that came up in a PR a couple months ago -- https://caniuse.com/#feat=css-overflow)

2. Provide some general resources?

For example...

3. Error handling?

Thinking specifically of this PR, and how useful it would be to maybe provide some rules around writing functions... IF the function needs a value, some error handling should be included: #4931

4. Best practices (flexbox over floats)

I realize this section could be HUGE in general but the one thing that always comes to my mind is preferring flexbox over floats.

Flexbox is just so much cleaner to write and debug once you learn the rules... I think it would be a worthwhile mention at least. But what do you think? (If you agree, might be worth dropping a link to https://css-tricks.com/snippets/css/a-guide-to-flexbox/)

docs/style.md Outdated Show resolved Hide resolved
docs/style.md Outdated Show resolved Hide resolved
docs/style.md Outdated Show resolved Hide resolved
docs/style.md Outdated Show resolved Hide resolved
docs/style.md Outdated Show resolved Hide resolved
docs/style.md Outdated Show resolved Hide resolved
joshblack and others added 2 commits January 15, 2020 10:44
Co-Authored-By: Jen Downs <[email protected]>
Co-Authored-By: Jen Downs <[email protected]>
@joshblack
Copy link
Contributor Author

@jendowns thanks for the feedback, definitely agreed on a lot of what you brought up. Would you have any interest in adding sections on some, or all (😂), of them?

@jendowns
Copy link
Contributor

jendowns commented Jan 15, 2020

@joshblack Yeah, I would be happy to help! Maybe a general "best practices" section that could include the notes about error handling, shorthand rules, and flexbox over floats? (Plus maybe other things that may come to mind). I could open as a different PR so you could provide feedback separately from this one? (Unless you prefer it all to be here?)

@joshblack
Copy link
Contributor Author

@jendowns definitely feel free to do a separate PR!

@joshblack
Copy link
Contributor Author

FYI @alisonjoseph

Copy link
Contributor

@vpicone vpicone left a comment

Choose a reason for hiding this comment

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

🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾

Use only as much specificity as needed

🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾🎆🍾

Looks great, next step style-lint and css modules!

Copy link
Contributor

@aledavila aledavila left a comment

Choose a reason for hiding this comment

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

sorry i took long!! looks great!!

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

might be jumping the gun but do we want to add rules for css property declaration order? for example the order in this style lint config is 1. positioning, 2. box model, 3. typography, 4. visual, then miscellaneous properties. alphabetical order would work too I guess, but overall I think being aware of property order can help deduplicate rules

@joshblack
Copy link
Contributor Author

joshblack commented Jan 16, 2020

@emyarod I think that'd be super helpful, especially if we tie it to the lint config. Would you have time/interest in putting a PR together? 👀

Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

Echoing @emyarod and think some style rules would be very beneficial. Looks good 👍

@joshblack joshblack merged commit 5513126 into carbon-design-system:master Jan 16, 2020
@joshblack joshblack deleted the docs/add-style-guide-updates branch January 16, 2020 23:32
joshblack added a commit to joshblack/carbon that referenced this pull request Jan 23, 2020
* docs(style): add scss section to style guide

* Update docs/style.md

Co-Authored-By: Abbey Hart <[email protected]>

* Update docs/style.md

Co-Authored-By: Jen Downs <[email protected]>

* Update docs/style.md

Co-Authored-By: Jen Downs <[email protected]>

* docs(style): update based on feedback

Co-authored-by: Abbey Hart <[email protected]>
Co-authored-by: Jen Downs <[email protected]>
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.

9 participants