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

Base Media Query Setup #62

Merged
merged 2 commits into from
Dec 5, 2018

Conversation

arcticicestudio
Copy link
Contributor

Associated epic: #52
Resolves GH-61

To simplify the usage of media queries (1) with styled-components (2),
a utility function to generate media templates (3) will be implemented.
It'll use the `min-width` parameter to fulfill the used "mobile-first"
approach. The base size that'll be used has been implemented as theme
property in GH-54 (4).

References:
  (1) https://developer.mozilla.org/de/docs/Web/CSS/Media_Queries/Using_media_queries
  (2) #52
  (3) https://www.styled-components.com/docs/advanced#media-templates
  (4) https://github.com/arcticicestudio/nord-docs/pull/55/files#diff-90a2aa45c339ce4720a7fbbd23c65e3eR49

Associated epic: #52
GH-61
| Always adjust media queries to the content individually and not vice-versa.
| The design supports the content. Not the other way around.

Like documented in the GH-52, Nord Docs uses the mobile-first pattern
and follows the great "Google Developer Responsive Web Design
guidelines (1). The recommended way is to create media queries not based
on any device sizes but individually based on the content which is
unique for each project. This is the best practice and, contrary to most
popular CSS framework like Bootstrap, the correct way since each site is
different and there are thousands of devices and in the future new sizes
will appear.
Therefore, this commit includes the initial media query template
functions that define the smallest `min-width` query `base` (`<320px`)
and `minimal` (`>=320px`).

References:
  (1) https://developers.google.com/web/fundamentals/design-and-ux/responsive

Associated epic: GH-52
GH-61
@codecov
Copy link

codecov bot commented Dec 5, 2018

Codecov Report

Merging #62 into develop will increase coverage by 1.08%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #62      +/-   ##
===========================================
+ Coverage    78.57%   79.66%   +1.08%     
===========================================
  Files           17       20       +3     
  Lines           56       59       +3     
  Branches         9        9              
===========================================
+ Hits            44       47       +3     
  Misses           9        9              
  Partials         3        3
Flag Coverage Δ
#unit 79.66% <100%> (+1.08%) ⬆️
Impacted Files Coverage Δ
src/styles/theme/breakpoints.js 100% <100%> (ø)
src/styles/theme/media.js 100% <100%> (ø)
src/styles/theme/index.js 100% <100%> (ø) ⬆️
src/styles/theme/utils/generateMediaQuery.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c014694...b209edb. Read the comment docs.

@arcticicestudio arcticicestudio merged commit 6b78d69 into develop Dec 5, 2018
@arcticicestudio arcticicestudio deleted the feature/gh-61-base-media-query-setup branch December 5, 2018 14:23
@arcticicestudio arcticicestudio removed their assignment Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants