From dc9ece3c78c1880a408629fdf41c691024c524b8 Mon Sep 17 00:00:00 2001 From: Zarino Zappia Date: Mon, 25 Jul 2016 11:04:22 +0100 Subject: [PATCH] Super quick fix for house tabs on mobile Also includes some fixes for various term_table page elements that were causing horizontal scrolling on narrow screens. --- views/sass/_components.scss | 15 +++++++++++++++ views/sass/_mixins.scss | 15 +++++++++++++++ views/sass/_typography.scss | 4 ++++ views/sass/_variables.scss | 1 + 4 files changed, 35 insertions(+) diff --git a/views/sass/_components.scss b/views/sass/_components.scss index 28eff74d6..481a278f6 100644 --- a/views/sass/_components.scss +++ b/views/sass/_components.scss @@ -513,6 +513,17 @@ p.lead { @extend .inline-list; padding-top: 1em; + // Make the tabs scroll horizontally on small screens. + // TODO: Make this not suck when the currently selected tab is + // hidden off to the far right of the line. + @media (max-width: $small_screen_max) { + text-align: left; + white-space: nowrap; + overflow: auto; + margin: 0 -1em; + padding: 1em 0.5em 0 0.5em; + } + @media (min-width: $medium_screen) and (min-height: 600px) { padding-top: 1.5em; } @@ -538,3 +549,7 @@ p.lead { .house-tab--active:focus { background: #fff; } + +.source-credits a { + @extend .break-word; +} diff --git a/views/sass/_mixins.scss b/views/sass/_mixins.scss index 4650ca146..5261ae595 100644 --- a/views/sass/_mixins.scss +++ b/views/sass/_mixins.scss @@ -121,3 +121,18 @@ } } } + +.break-word { + // https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/ + overflow-wrap: break-word; + word-wrap: break-word; + + -ms-word-break: break-all; + word-break: break-all; + word-break: break-word; + + -ms-hyphens: auto; + -moz-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} diff --git a/views/sass/_typography.scss b/views/sass/_typography.scss index 2c6455aa2..901328834 100644 --- a/views/sass/_typography.scss +++ b/views/sass/_typography.scss @@ -171,6 +171,10 @@ textarea { -webkit-appearance: none; } +select { + max-width: 100%; +} + fieldset { padding: 0; border: 0; diff --git a/views/sass/_variables.scss b/views/sass/_variables.scss index d96ac3a69..df5564321 100644 --- a/views/sass/_variables.scss +++ b/views/sass/_variables.scss @@ -34,6 +34,7 @@ $high_dpi_screen: '-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi $large_screen_max: $giant_screen - (1em * (1px / $size_font-base)); $medium_screen_max: $large_screen - (1em * (1px / $size_font-base)); +$small_screen_max: $medium_screen - (1em * (1px / $size_font-base)); $animation-short: 0.2s ease-out;