Skip to content

Commit

Permalink
Adding a text-overflow: ellipsis; mixin and related cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomerobot committed Nov 6, 2019
1 parent 1aa96a5 commit b066a41
Show file tree
Hide file tree
Showing 31 changed files with 61 additions and 159 deletions.
8 changes: 2 additions & 6 deletions app/assets/stylesheets/common/admin/admin_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,7 @@ $mobile-breakpoint: 700px;
}
td.x-value {
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include ellipsis;
}
}
.bar-container {
Expand Down Expand Up @@ -861,9 +859,7 @@ table#user-badges {
.value-list {
.value {
padding: 0.125em 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
display: flex;

&:last-child {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@

&.title {
text-align: left;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
@include ellipsis;

.d-icon {
color: $primary-low-mid;
Expand Down
15 changes: 4 additions & 11 deletions app/assets/stylesheets/common/admin/admin_report_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
&.two-columns {
.table .admin-report-table-cell:first-child,
.table .admin-report-table-header:first-child {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
@include ellipsis;
text-align: left;
width: 80%;
}
Expand Down Expand Up @@ -32,8 +30,7 @@
outline: none;
background: none;
padding: 3px 8px;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}

&.is-current-sort {
Expand Down Expand Up @@ -106,9 +103,7 @@
}

.admin-report-table-cell.term {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
@include ellipsis;
}
}

Expand All @@ -132,9 +127,7 @@

.admin-report-table-cell.post,
.admin-report-table-cell.edit_reason {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
@include ellipsis;
}
}

Expand Down
6 changes: 5 additions & 1 deletion app/assets/stylesheets/common/admin/customize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,11 @@
.category,
.external_url,
.post {
text-overflow: ellipsis;
@include ellipsis;
max-width: 100px;
@include breakpoint(tablet) {
max-width: 100%;
}
}

&.grid tr.admin-list-item {
Expand Down
8 changes: 2 additions & 6 deletions app/assets/stylesheets/common/admin/emails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@
}
.username div {
max-width: 180px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}
.addresses p {
margin: 2px 0;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}
}

Expand Down
4 changes: 1 addition & 3 deletions app/assets/stylesheets/common/admin/users.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@

.admin-users-list {
td.username {
white-space: nowrap;
@include ellipsis;
overflow-wrap: break-word;
overflow: hidden;
text-overflow: ellipsis;
}
@media screen and (max-width: 970px) and (min-width: 768px) {
td.username {
Expand Down
15 changes: 3 additions & 12 deletions app/assets/stylesheets/common/base/category-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
.category-name {
display: inline-block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
vertical-align: text-top;
line-height: $line-height-medium;
}
Expand Down Expand Up @@ -109,8 +108,6 @@
color: dark-light-choose($primary-medium, $secondary-high);
.overflow {
max-height: 6em;
overflow: hidden;
text-overflow: ellipsis;
}
}

Expand All @@ -122,7 +119,6 @@
text-align: center;
color: $primary;
overflow: hidden;
text-overflow: ellipsis;
}

.subcategories {
Expand All @@ -131,9 +127,7 @@
.subcategory {
display: flex;
align-items: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include ellipsis;
margin-right: 1em;
margin-bottom: 0.6em;
.subcategory-image-placeholder {
Expand All @@ -142,8 +136,7 @@
}
.subcategory-link {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}
.logo img {
display: inline-block;
Expand All @@ -166,7 +159,6 @@
font-size: $font-up-2;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
}

.category-box-heading {
Expand All @@ -192,7 +184,6 @@
.overflow {
max-height: 3em;
overflow: hidden;
text-overflow: ellipsis;
}
.d-icon {
margin-right: 0.15em;
Expand Down
12 changes: 3 additions & 9 deletions app/assets/stylesheets/common/base/compose.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@
}

.action-title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}

.topic-link,
Expand All @@ -136,9 +134,7 @@
.username {
margin-right: 5px;
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include ellipsis;
@media screen and (max-width: 500px) {
display: none;
}
Expand Down Expand Up @@ -358,9 +354,7 @@
a {
padding: 5px;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;

span.username {
color: $primary;
Expand Down
4 changes: 1 addition & 3 deletions app/assets/stylesheets/common/base/emoji.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ sup img.emoji {
}

.emoji-picker .info {
text-overflow: ellipsis;
@include ellipsis;
padding-left: 8px;
white-space: nowrap;
overflow: hidden;
font-weight: 700;
max-width: 125px;
}
Expand Down
20 changes: 5 additions & 15 deletions app/assets/stylesheets/common/base/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@
.topic-link {
color: $header_primary;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}
.topic-statuses {
.d-icon {
Expand Down Expand Up @@ -275,9 +273,7 @@
flex: 0 1 auto;
min-width: 1px;
.badge-wrapper {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include ellipsis;
}
}
.badge-wrapper {
Expand Down Expand Up @@ -305,9 +301,7 @@
flex: 1 0 0%; // unit on flex-basis is required for IE11
.discourse-tags {
color: $header_primary-high;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include ellipsis;
.discourse-tag {
display: inline; // tags need to stay inline in order for them to truncate
}
Expand Down Expand Up @@ -357,9 +351,7 @@ $mobile-avatar-height: 1.532em;
padding: 0 5px;
border: 1px solid $primary-low;
border-radius: 0.25em;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include ellipsis;

.icon {
display: flex;
Expand All @@ -376,9 +368,7 @@ $mobile-avatar-height: 1.532em;
}

span {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include ellipsis;
}
}

Expand Down
4 changes: 1 addition & 3 deletions app/assets/stylesheets/common/base/lightbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ $meta-element-margin: 6px;

.filename {
margin: $meta-element-margin;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@include ellipsis;
}

.d-icon {
Expand Down
8 changes: 1 addition & 7 deletions app/assets/stylesheets/common/base/menu-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@
line-height: $line-height-large;
}
.badge-wrapper {
overflow: hidden;
text-overflow: ellipsis;
&.bar,
&.bullet {
color: $primary;
Expand All @@ -143,8 +141,6 @@

span.badge-category {
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
}

div.discourse-tags {
Expand Down Expand Up @@ -341,9 +337,7 @@ div.menu-links-header {
span.d-label {
display: block;
max-width: 130px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include ellipsis;
}

@include breakpoint(mobile-medium) {
Expand Down
9 changes: 3 additions & 6 deletions app/assets/stylesheets/common/base/onebox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -562,21 +562,18 @@ aside.onebox.twitterstatus .onebox-body {
.outer-box {
position: absolute;
z-index: z("base");
overflow: hidden;
font-size: $font-down-1;
color: #fff;
background-color: rgba(0, 0, 0, 0.6);
text-overflow: ellipsis;
max-width: 100%;
@include ellipsis;
max-width: 690px;
padding: 5px 0;

.inner-box {
padding-left: 10px;
padding-right: 10px;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: normal;
white-space: nowrap;
@include ellipsis;

.album-title {
width: 100%;
Expand Down
7 changes: 2 additions & 5 deletions app/assets/stylesheets/common/base/reviewables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@
.reviewed-by {
display: flex;
align-items: center;
white-space: nowrap;
}

.user-flag-percentage {
Expand All @@ -309,8 +308,7 @@
&.user a,
&.reviewed-by a {
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}
}

Expand All @@ -327,8 +325,7 @@
padding: 0.5em 1em 0.5em 0;
}
@include breakpoint("mobile-large") {
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
padding-right: 0.5em;
}
}
Expand Down
8 changes: 2 additions & 6 deletions app/assets/stylesheets/common/base/search-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@

.name,
.slug {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}

.name {
Expand Down Expand Up @@ -207,9 +205,7 @@

.username,
.name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include ellipsis;
}

.username {
Expand Down
Loading

1 comment on commit b066a41

@discoursebot
Copy link

Choose a reason for hiding this comment

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

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/discourse-calendar-plugin-failing-on-stable-branch/138554/5

Please sign in to comment.