From ed2a4241b8ad3e85cba9fc492978b259645ef1ad Mon Sep 17 00:00:00 2001 From: Max Karkowski Date: Fri, 17 Jul 2020 09:13:46 +0200 Subject: [PATCH] fix media queries temporarily --- src/components/Branding/branding.scss | 6 +- src/components/FooterEnd/footerend.scss | 6 +- .../HeadlineGroup/headline-group.scss | 10 ++- .../HeroHeadline/hero-headline.scss | 7 ++- .../QuadrantGrid/quadrant-grid.scss | 7 ++- .../QuadrantSection/quadrant-section.scss | 7 ++- src/index.scss | 62 ++++++++++++++----- src/styles/base.scss | 42 ------------- src/styles/components/filter.scss | 6 +- src/styles/components/letter-index.scss | 13 ++-- src/styles/components/nav.scss | 9 ++- src/styles/components/page.scss | 12 ++-- src/styles/components/publish-date.scss | 14 +++-- src/styles/components/split.scss | 10 +-- src/styles/main.scss | 1 - src/styles/sccs-vars.scss | 4 ++ 16 files changed, 121 insertions(+), 95 deletions(-) delete mode 100644 src/styles/base.scss create mode 100644 src/styles/sccs-vars.scss diff --git a/src/components/Branding/branding.scss b/src/components/Branding/branding.scss index d4a2a21..a4198e2 100644 --- a/src/components/Branding/branding.scss +++ b/src/components/Branding/branding.scss @@ -1,3 +1,5 @@ +@import '../../styles/sccs-vars.scss'; + .branding { margin: 40px 0; display: flex; @@ -27,7 +29,7 @@ opacity: 0; } - @media (--until-sm) { + @media (max-width: $until-sm) { &--footer { display: block; text-align: center; @@ -38,7 +40,7 @@ } } - @media (--until-xl) { + @media (max-width: $until-xl) { margin: 15px 0 0; } } \ No newline at end of file diff --git a/src/components/FooterEnd/footerend.scss b/src/components/FooterEnd/footerend.scss index f057376..d6efdb7 100644 --- a/src/components/FooterEnd/footerend.scss +++ b/src/components/FooterEnd/footerend.scss @@ -1,3 +1,5 @@ +@import '../../styles/sccs-vars.scss'; + .footer-end { font-size: 12px; color: var(--color-gray-normal); @@ -17,7 +19,7 @@ margin-top: 100px; } - @media (--until-sm) { + @media (max-width: $until-sm) { flex-direction: column; align-items: center; margin: 20px 0 0; @@ -33,4 +35,4 @@ &__label { margin: 0 10px 0 0; } -} +} \ No newline at end of file diff --git a/src/components/HeadlineGroup/headline-group.scss b/src/components/HeadlineGroup/headline-group.scss index c9c1650..a6f90bc 100644 --- a/src/components/HeadlineGroup/headline-group.scss +++ b/src/components/HeadlineGroup/headline-group.scss @@ -1,13 +1,17 @@ +@import '../../styles/sccs-vars.scss'; + .headline-group { margin: 0 0 60px; - @media (--until-sm) { + + @media (max-width: $until-sm) { margin: 30px 0; } &--secondary { margin: 10px 0; - @media (--until-sm) { + + @media (max-width: $until-sm) { margin: 5px 0; } } -} +} \ No newline at end of file diff --git a/src/components/HeroHeadline/hero-headline.scss b/src/components/HeroHeadline/hero-headline.scss index 1c2007c..a30539a 100644 --- a/src/components/HeroHeadline/hero-headline.scss +++ b/src/components/HeroHeadline/hero-headline.scss @@ -1,3 +1,5 @@ +@import '../../styles/sccs-vars.scss'; + .hero-headline { font-size: 38px; font-weight: 300; @@ -14,10 +16,11 @@ color: var(--color-gray-light); } - @media (--until-sm) { + @media (max-width: $until-sm) { font-size: 26px; + &__alt { display: block; } } -} +} \ No newline at end of file diff --git a/src/components/QuadrantGrid/quadrant-grid.scss b/src/components/QuadrantGrid/quadrant-grid.scss index 0bb23e8..ced786c 100644 --- a/src/components/QuadrantGrid/quadrant-grid.scss +++ b/src/components/QuadrantGrid/quadrant-grid.scss @@ -1,3 +1,5 @@ +@import '../../styles/sccs-vars.scss'; + .quadrant-grid { display: flex; flex-wrap: wrap; @@ -6,8 +8,9 @@ &__quadrant { flex: 0 0 45%; margin-bottom: 40px; - @media (--until-lg) { + + @media (max-width: $until-lg) { flex-basis: 100%; } } -} +} \ No newline at end of file diff --git a/src/components/QuadrantSection/quadrant-section.scss b/src/components/QuadrantSection/quadrant-section.scss index 00df24b..dc37469 100644 --- a/src/components/QuadrantSection/quadrant-section.scss +++ b/src/components/QuadrantSection/quadrant-section.scss @@ -1,3 +1,5 @@ +@import '../../styles/sccs-vars.scss'; + .quadrant-section { &__header { margin-bottom: 20px; @@ -13,9 +15,10 @@ padding: 0 8px; flex: 0 0 25%; margin: 0 0 25px; - @media (--until-md) { + + @media (max-width: $until-md) { flex-basis: 50%; } } -} +} \ No newline at end of file diff --git a/src/index.scss b/src/index.scss index ebb70b9..9ddf172 100644 --- a/src/index.scss +++ b/src/index.scss @@ -1,18 +1,3 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} - @font-face { font-family: 'DIN'; src: url('./fonts/clanot-news.otf'); @@ -26,4 +11,51 @@ code { } +:root { + --color-gray-dark: #475157; + --color-gray-dark-alt: #4F585E; + --color-gray-dark-alt2: #434D53; + --color-gray-normal: #7f858a; + --color-gray-light: #7D878D; + + --color-white: #fff; + --color-green: #5CB449; + --color-orange: #FAA03D; + --color-blue: #40A7D1; + --color-marine: #688190; + --color-red: #F1235A; + --color-brand: #F59134; + --until-sm: 30em; + --until-md: 48em; + --until-lg: 61.875em; + --until-xl: 75em; +} + +// @custom-media --until-sm (max-width: 30em); +// @custom-media --until-md (max-width: 48em); +// @custom-media --until-lg (max-width: 61.875em); +// @custom-media --until-xl (max-width: 75em); + + + +body { + background: var(--color-gray-dark); + box-sizing: border-box; + margin: 0; + padding: 0; + font-family: 'DIN'; + font-weight: normal; + font-size: 14px; + line-height: 1.5; + + & h1 { + color: blue; + } +} + +#root { + min-height: 100vh; + overflow: hidden; +} + @import './styles/main.scss' \ No newline at end of file diff --git a/src/styles/base.scss b/src/styles/base.scss deleted file mode 100644 index a99b354..0000000 --- a/src/styles/base.scss +++ /dev/null @@ -1,42 +0,0 @@ -:root { - --color-gray-dark: #475157; - --color-gray-dark-alt: #4F585E; - --color-gray-dark-alt2: #434D53; - --color-gray-normal: #7f858a; - --color-gray-light: #7D878D; - - --color-white: #fff; - --color-green: #5CB449; - --color-orange: #FAA03D; - --color-blue: #40A7D1; - --color-marine: #688190; - --color-red: #F1235A; - --color-brand: #F59134; -} - -@custom-media --until-sm (max-width: 30em); -@custom-media --until-md (max-width: 48em); -@custom-media --until-lg (max-width: 61.875em); -@custom-media --until-xl (max-width: 75em); - - - -body { - background: var(--color-gray-dark); - box-sizing: border-box; - margin: 0; - padding: 0; - font-family: 'DIN'; - font-weight: normal; - font-size: 14px; - line-height: 1.5; - - & h1 { - color: blue; - } -} - -#root { - min-height: 100vh; - overflow: hidden; -} \ No newline at end of file diff --git a/src/styles/components/filter.scss b/src/styles/components/filter.scss index 8332bbb..500a0e8 100644 --- a/src/styles/components/filter.scss +++ b/src/styles/components/filter.scss @@ -1,8 +1,10 @@ +@import '../../styles/sccs-vars.scss'; + .filter { margin-bottom: 40px; /* @todo: re-enable filter for mobile */ - @media (--until-sm) { + @media (max-width: $until-sm) { display: none; } -} +} \ No newline at end of file diff --git a/src/styles/components/letter-index.scss b/src/styles/components/letter-index.scss index 07b9b2c..7c59b3f 100644 --- a/src/styles/components/letter-index.scss +++ b/src/styles/components/letter-index.scss @@ -1,12 +1,16 @@ +@import '../../styles/sccs-vars.scss'; + .letter-index { margin-bottom: 60px; + &__group { border-top: 1px solid var(--color-gray-normal); position: relative; padding: 0 0 0 200px; min-height: 80px; - @media (--until-md) { - padding: 0 0 0 50px; + + @media (max-width: $until-md) { + padding: 0 0 0 50px; } } @@ -17,8 +21,9 @@ position: absolute; left: 50px; top: 0; - @media (--until-md) { + + @media (max-width: $until-md) { left: 0; } } -} +} \ No newline at end of file diff --git a/src/styles/components/nav.scss b/src/styles/components/nav.scss index 05ff031..1578360 100644 --- a/src/styles/components/nav.scss +++ b/src/styles/components/nav.scss @@ -1,10 +1,13 @@ +@import '../../styles/sccs-vars.scss'; + .nav { white-space: nowrap; &__item { display: inline-flex; position: relative; - & + .nav__item { + + &+.nav__item { margin-left: 20px; } } @@ -32,11 +35,11 @@ } &--relations { - @media (--until-md) { + @media (max-width: $until-md) { .nav__item { display: block; margin: 5px 0 0; } } } -} +} \ No newline at end of file diff --git a/src/styles/components/page.scss b/src/styles/components/page.scss index c887bb4..b2313e6 100644 --- a/src/styles/components/page.scss +++ b/src/styles/components/page.scss @@ -1,3 +1,5 @@ +@import '../../styles/sccs-vars.scss'; + .page { max-width: 1200px; min-height: 100%; @@ -13,11 +15,11 @@ position: relative; z-index: 100; - @media (--until-sm) { - margin: 0 - } + @media (max-width: $until-sm) { + margin: 0 + } - @media (--until-lg) { + @media (max-width: $until-lg) { .nav { display: none; } @@ -32,4 +34,4 @@ margin-top: 5px; flex: 0 0 auto; } -} +} \ No newline at end of file diff --git a/src/styles/components/publish-date.scss b/src/styles/components/publish-date.scss index 5143afb..66560e0 100644 --- a/src/styles/components/publish-date.scss +++ b/src/styles/components/publish-date.scss @@ -1,8 +1,10 @@ -.publish-date { - color: var(--color-gray-normal); - text-align: right; +@import '../../styles/sccs-vars.scss'; - @media (--until-sm) { - text-align: center; - } +.publish-date { + color: var(--color-gray-normal); + text-align: right; + + @media (max-width: $until-sm) { + text-align: center; + } } \ No newline at end of file diff --git a/src/styles/components/split.scss b/src/styles/components/split.scss index e1e72f0..6af85e6 100644 --- a/src/styles/components/split.scss +++ b/src/styles/components/split.scss @@ -1,3 +1,5 @@ +@import '../../styles/sccs-vars.scss'; + .split { display: flex; align-items: center; @@ -19,7 +21,7 @@ flex: 0 1 auto; } - @media (--until-sm) { - display: block; - } -} + @media (max-width: $until-sm) { + display: block; + } +} \ No newline at end of file diff --git a/src/styles/main.scss b/src/styles/main.scss index fc6fb8f..223d7e1 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -1,4 +1,3 @@ -@import "./base"; @import "./components/button"; @import "./components/content"; @import "./components/filter"; diff --git a/src/styles/sccs-vars.scss b/src/styles/sccs-vars.scss new file mode 100644 index 0000000..35f5c89 --- /dev/null +++ b/src/styles/sccs-vars.scss @@ -0,0 +1,4 @@ +$until-sm: 30em; +$until-md: 48em; +$until-lg: 61.875em; +$until-xl: 75em; \ No newline at end of file