From 18877f6f1b21ff0ceec546695fd7aec9f0d6e4b7 Mon Sep 17 00:00:00 2001 From: Suzanne Aitchison Date: Tue, 8 Mar 2022 10:37:52 +0000 Subject: [PATCH] Avoid layout funkiness when non-breaking characters are used (#16782) * Apply overflow-wrap fallback everywhere we use anywhere value * fix some more non breaking spaces layout issues * user with org sidebar * comment index header --- app/assets/stylesheets/base/main.scss | 3 +++ app/assets/stylesheets/components/cards.scss | 3 +++ app/assets/stylesheets/components/links.scss | 1 + app/assets/stylesheets/components/profile-preview-card.scss | 3 +++ app/assets/stylesheets/components/stories.scss | 5 +++++ app/assets/stylesheets/preact/onboarding-modal.scss | 3 +++ app/assets/stylesheets/views/article.scss | 2 ++ app/assets/stylesheets/views/dashboard.scss | 3 +++ app/assets/stylesheets/views/listings.scss | 3 +++ app/assets/stylesheets/views/signin.scss | 4 ++++ app/views/articles/_sidebar.html.erb | 2 +- app/views/articles/_sidebar_additional.html.erb | 2 +- app/views/articles/_sidebar_listings.html.erb | 2 +- app/views/comments/index.html.erb | 2 +- app/views/stories/_sign_in_invitation.html.erb | 4 ++-- app/views/users/_sidebar.html.erb | 2 +- app/views/users/show.html.erb | 2 +- 17 files changed, 38 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/base/main.scss b/app/assets/stylesheets/base/main.scss index d3dce9cfb..89fa40e02 100644 --- a/app/assets/stylesheets/base/main.scss +++ b/app/assets/stylesheets/base/main.scss @@ -77,6 +77,9 @@ a { letter-spacing: -0.02em; line-height: 1; outline: 0; + + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; &__img, diff --git a/app/assets/stylesheets/components/cards.scss b/app/assets/stylesheets/components/cards.scss index b409a0ce7..deed222d0 100644 --- a/app/assets/stylesheets/components/cards.scss +++ b/app/assets/stylesheets/components/cards.scss @@ -54,6 +54,9 @@ border-radius: var(--radius-auto); background: var(--card-bg); box-shadow: 0 0 0 1px var(--card-border); + + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; &__revealable { diff --git a/app/assets/stylesheets/components/links.scss b/app/assets/stylesheets/components/links.scss index ca2a1e169..456cbf487 100644 --- a/app/assets/stylesheets/components/links.scss +++ b/app/assets/stylesheets/components/links.scss @@ -13,6 +13,7 @@ outline: 0; text-decoration: none; color: var(--color); + max-width: 100%; &--block { display: flex; diff --git a/app/assets/stylesheets/components/profile-preview-card.scss b/app/assets/stylesheets/components/profile-preview-card.scss index ea2176bd5..f964a5ab0 100644 --- a/app/assets/stylesheets/components/profile-preview-card.scss +++ b/app/assets/stylesheets/components/profile-preview-card.scss @@ -10,6 +10,9 @@ left: 0; font-size: var(--fs-base); font-weight: var(--fw-normal); + + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; } diff --git a/app/assets/stylesheets/components/stories.scss b/app/assets/stylesheets/components/stories.scss index 7c2731daf..4a18f25da 100644 --- a/app/assets/stylesheets/components/stories.scss +++ b/app/assets/stylesheets/components/stories.scss @@ -152,6 +152,9 @@ color: var(--card-color); line-height: var(--lh-tight); font-size: var(--title-font-size); + + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; margin-bottom: var(--su-1); @@ -238,6 +241,8 @@ color: black; background: yellow; } + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; } diff --git a/app/assets/stylesheets/preact/onboarding-modal.scss b/app/assets/stylesheets/preact/onboarding-modal.scss index 87110c08e..08e56c2b8 100644 --- a/app/assets/stylesheets/preact/onboarding-modal.scss +++ b/app/assets/stylesheets/preact/onboarding-modal.scss @@ -460,6 +460,9 @@ $onboarding-user-selected-hover: rgba(71, 85, 235, 0.2); .user-summary { margin: 0; line-height: var(--lh-tight); + + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; } diff --git a/app/assets/stylesheets/views/article.scss b/app/assets/stylesheets/views/article.scss index e05d10b8c..0d0582b28 100644 --- a/app/assets/stylesheets/views/article.scss +++ b/app/assets/stylesheets/views/article.scss @@ -41,6 +41,8 @@ } &__header { + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; diff --git a/app/assets/stylesheets/views/dashboard.scss b/app/assets/stylesheets/views/dashboard.scss index f0d9acad3..a2cf615b6 100644 --- a/app/assets/stylesheets/views/dashboard.scss +++ b/app/assets/stylesheets/views/dashboard.scss @@ -24,6 +24,9 @@ &__title { grid-column-end: span 2; + + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; @media (min-width: $breakpoint-m) { diff --git a/app/assets/stylesheets/views/listings.scss b/app/assets/stylesheets/views/listings.scss index 7a3cd32b4..27ed8c13c 100644 --- a/app/assets/stylesheets/views/listings.scss +++ b/app/assets/stylesheets/views/listings.scss @@ -14,6 +14,9 @@ .single-listing { $el: &; + + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; overflow: hidden; diff --git a/app/assets/stylesheets/views/signin.scss b/app/assets/stylesheets/views/signin.scss index 851278617..31611854e 100644 --- a/app/assets/stylesheets/views/signin.scss +++ b/app/assets/stylesheets/views/signin.scss @@ -51,6 +51,10 @@ font-size: var(--fs-2xl); line-height: var(--lh-tight); + // overflow-wrap: anywhere isn't supported in Safari, in which case this fallback applies + overflow-wrap: break-word; + overflow-wrap: anywhere; + @media (min-width: $breakpoint-s) { font-size: var(--fs-3xl); } diff --git a/app/views/articles/_sidebar.html.erb b/app/views/articles/_sidebar.html.erb index c6e990d3c..797bf8d35 100644 --- a/app/views/articles/_sidebar.html.erb +++ b/app/views/articles/_sidebar.html.erb @@ -1,4 +1,4 @@ -