Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Improve contribution guidelines #363

Merged

Conversation

melanierichards
Copy link
Contributor

@melanierichards melanierichards commented Apr 6, 2017

What this PR does

  • Moves the contribution guidelines into its own file to reduce clutter in README (still linked from there)
  • Expands a little in those guidelines
  • Adds a document for CSS code style

Comments for reviewers

  • @gregwhitworth: don't feel like you need to inspect every letter in this PR, mostly interested in your feedback on these improvements as a person who recently opened a PR with a new demo and would've benefited from better communication. :]
  • @dstorey: I added a slightly modified version of the CSS style guide from our internal component library. If you want to give any feedback on this PR, feel free.

Copy link
Contributor

@gregwhitworth gregwhitworth left a comment

Choose a reason for hiding this comment

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

I left a little bit of feedback, this is a style guide and you all own it - so their just opinions. So I'm going to approve as it's your call whether to take them or leave them :)


### White Space and Indentations

* Use tabs instead of spaces for indentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this an actual \t character? Isn't the JS style guides to utilize spaces? If so they should be consistent as most people will have their IDEs setup to convert between the two.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@molant what does the JS style guide in Demos say on tabs vs spaces? Personally I prefer spaces, but we've gone with tabs on the dev site and the CSS library.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should be using tabs in JS

Copy link
Member

Choose a reason for hiding this comment

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

doesn't our editorconfig set the correct tab vs space anyway (if their editor supports that of course) . I think VScode generally is smart enough to know what project uses and continues with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't guarantee everyone's going to be in the right editor for that, so it's good to set expectations here too.

* @TODO: call out something that hasn't been completed yet and needs to be updated/fixed.
* @Bug: link to a bug either in the project or a browser. Optionally describe the bug if context is needed. Use with @Browser if calling out a browser bug.
* @Browser: notify if a piece of code is included for a particular browser (not needed if obvious, such as prefixes for old versions.)
* @HACK: call out an ugly hack; either a CSS hack to work around browser issues, or a hacky piece of code that should be cleaned up later.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to have this linked to the browser bug for said hack if it is browser specific. This may allow for removal down the road.

* Build responsiveness mobile-first, legacy first. That is, the base style should be the “mobile” size, with a max width set for old browsers that don’t understand media queries.
* Add styles for wider levels using media queries, building from the smallest media query up. Minimize use of mutually-exclusive media queries (queries with a min and max).
* Use `em` for media query values. Doing this ensures that when the user zooms in, the site will switch to the appropriate layout for how the text wraps at that zoom level.
* Don’t collect all responsive styles into one section at the end of a stylesheet or in a new stylesheet altogether. Instead, add media queries directly beneath the selectors that the media queries modify.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a fan of this one, this is going to make replication of the MQs annoying and keeping those in sync will be a pain. This is trading one problem (finding the selector you wish to modify) for another, the MQ breakpoints and needing to redefine them numerous times. Ultimately though, this is a style thing - and you all own it - so...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can relax this one for Demos.

@melanierichards
Copy link
Contributor Author

Made slight changes based on @gregwhitworth's feedback!

@melanierichards melanierichards merged commit 63e579e into MicrosoftEdge:master Sep 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants