Skip to content

A platform for community discussion. Free, open, simple.

REFACTOR: merge mobile and desktop user CSS into common file (#34787)

Kris6a6ef122647e
diff --git a/app/assets/stylesheets/common/base/user.scss b/app/assets/stylesheets/common/base/user.scss
index 8cd36bfab3b..81ad3d02e19 100644
--- a/app/assets/stylesheets/common/base/user.scss
+++ b/app/assets/stylesheets/common/base/user.scss
@@ -36,7 +36,6 @@
grid-column-end: 3;
grid-row-start: 2;
grid-row-end: 3;
- border-bottom: 1px solid var(--content-border-color);
font-size: var(--font-down-1);
}
@@ -49,6 +48,7 @@
flex: 1 0 auto;
a {
+ box-sizing: border-box;
width: 100%;
justify-content: center;
}
@@ -83,6 +83,10 @@
}
.user-content {
+ box-sizing: border-box;
+ margin-top: 2em;
+ background: var(--d-content-background, var(--secondary));
+
.list-actions {
display: flex;
margin-bottom: 12px;
@@ -126,6 +130,7 @@
.user-main {
background: var(--d-content-background);
+ padding-bottom: 60px;
.about {
width: 100%;
@@ -136,11 +141,31 @@
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
+ height: 200px;
+
+ @include viewport.from(md) {
+ height: 300px;
+ }
}
.staff-counters {
margin-bottom: 0;
}
+
+ @include viewport.until(md) {
+ &:not(.collapsed-info) .details .user-profile-avatar {
+ margin-top: -60px;
+ }
+ }
+
+ @include viewport.from(md) {
+ .details {
+ box-sizing: border-box;
+ width: 100%;
+ padding: 15px 0 0 0;
+ bottom: 0;
+ }
+ }
}
.secondary {
@@ -154,7 +179,7 @@
dl {
margin: 0;
- padding: 0.25em 0;
+ padding: 0.5em 0;
div {
display: inline-flex;
@@ -200,12 +225,10 @@
background: rgb(var(--secondary-rgb), 0.8);
border-bottom: 1px solid var(--content-border-color);
- .groups {
- display: inline;
- }
-
- img.avatar {
- float: left;
+ @include viewport.from(md) {
+ img.avatar {
+ margin: 0 20px 10px 0;
+ }
}
.suspended {
@@ -221,10 +244,25 @@
position: relative;
display: flex;
+ @include viewport.until(md) {
+ flex-wrap: wrap;
+ }
+
.bio {
max-height: 300px;
overflow: auto;
+ @include viewport.until(md) {
+ text-align: center;
+
+ ul,
+ ol {
+ display: inline-block;
+ padding-left: 0;
+ text-align: left;
+ }
+ }
+
img {
max-width: 100%;
}
@@ -235,28 +273,104 @@
position: relative;
align-self: flex-start;
+ @include viewport.until(md) {
+ margin: 8px auto;
+ }
+
.avatar-flair {
- bottom: 8px;
- right: 16px;
+ right: 2px;
+
+ @include viewport.from(md) {
+ right: 16px;
+ bottom: 8px;
+ }
}
}
}
.controls {
+ @include viewport.until(md) {
+ flex: 1 1 25%;
+ }
+
+ @include viewport.from(md) {
+ align-self: center;
+ max-width: 13.5em;
+ margin-left: 0.5em;
+
+ .btn {
+ min-width: 9em;
+ width: 100%;
+ }
+ }
+
ul {
display: flex;
flex-wrap: wrap;
gap: 0.5em;
list-style-type: none;
margin: 0 0 0.5em 0;
+
+ @include viewport.until(md) {
+ li,
+ > span {
+ display: flex;
+ flex: 1 1 45%;
+
+ button,
+ a {
+ width: 100%;
+ }
+
+ .select-kit.dropdown-select-box.user-notifications-dropdown {
+ width: 100%;
+ }
+ }
+ }
}
}
&.collapsed-info {
+ @include viewport.from(md) {
+ .user-profile-image {
+ display: none;
+ }
+ }
+
.details {
margin-top: 0;
background: rgb(var(--secondary-rgb), 0.8);
+ @include viewport.until(md) {
+ display: flex;
+ margin-bottom: 0;
+ }
+
+ @include viewport.from(md) {
+ position: relative;
+ padding: 0;
+ margin-top: 0;
+ border-bottom: 1px solid var(--content-border-color);
+
+ .controls {
+ display: flex;
+ max-width: unset;
+ flex: 1 2 min-content;
+
+ > ul {
+ flex-wrap: wrap;
+ margin-left: auto;
+ justify-content: end;
+ }
+ }
+ }
+
+ @include viewport.until(md) {
+ .user-profile-names {
+ text-align: left;
+ }
+ }
+
.bio {
display: none;
}
@@ -283,10 +397,23 @@
.user-profile__featured-topic {
display: none;
}
+
+ @include viewport.until(md) {
+ .primary-textual {
+ flex: 1 0 80%;
+ margin: 0;
+ }
+ }
}
}
.user-profile-avatar {
+ @include viewport.until(md) {
+ margin: 0;
+ flex: 0 0 auto;
+ align-self: flex-start;
+ }
+
.avatar-flair {
bottom: 8px;
right: 2px;
@@ -367,6 +494,12 @@
font-size: var(--font-down-1);
}
}
+
+ @include viewport.from(md) {
+ input[type="text"] {
+ width: 530px;
+ }
+ }
}
.user-content {
@@ -394,6 +527,11 @@
.public-user-fields {
margin-top: 8px;
margin-bottom: 8px;
+ overflow: hidden;
+
+ @include viewport.until(md) {
+ text-align: center;
+ }
.user-field-name {
font-weight: bold;
@@ -499,15 +637,22 @@
li {
display: inline-block;
- padding: 10px 14px 10px 0;
- margin: 0 10px 10px 0;
+ margin: 0 15px 10px 0;
+ padding: 0;
+
+ @include viewport.from(md) {
+ padding: 10px 14px 10px 0;
+ margin: 0 10px 10px 0;
+ }
&.linked-stat {
// This makes the entire "box" (the li) clickable instead of a narrow area.
padding: 0;
a {
- padding: 10px 14px 10px 0;
+ @include viewport.from(md) {
+ padding: 10px 14px 10px 0;
+ }
width: 100%;
height: 100%;
display: block;
@@ -881,8 +1026,9 @@
.second-factor {
.second-factor-item {
- width: 100%;
+ width: auto;
display: flex;
+ gap: 1em;
justify-content: space-between;
border-top: 1px solid var(--content-border-color);
margin: 0.25em 0;
@@ -953,7 +1099,14 @@
.primary-textual {
flex: 1 1 auto;
min-width: 0;
- margin-right: auto;
+ word-break: break-word;
+ max-width: 100%;
+
+ @include viewport.from(md) {
+ margin-right: auto;
+ flex: 0 1 auto;
+ padding: 0 0 0.5em;
+ }
}
.primary-textual .staged,
@@ -1010,6 +1163,10 @@
.user-profile-location {
margin-right: 1em;
}
+
+ @include viewport.until(md) {
+ justify-content: center;
+ }
}
.selectable-avatars {
@@ -1196,3 +1353,51 @@
}
}
}
+
+.user-profile-hidden {
+ font-size: var(--font-up-2);
+ text-align: center;
+}
+
+.pref-avatar {
+ .avatar {
+ max-width: 90px;
+ max-height: 90px;
+ }
+}
+
+.user-invite-search {
+ input {
+ margin: 0;
+ }
+}
+
+.user-messages-page {
+ .paginated-topics-list {
+ margin-top: 0;
+ }
+
+ .show-mores {
+ // See N new topics message
+ margin-top: 0.5em;
+
+ @include viewport.from(md) {
+ position: absolute;
+ }
+ }
+}
+
+@include viewport.until(md) {
+ .featured-topic {
+ text-align: center;
+ font-size: var(--font-0);
+ }
+
+ .user-profile-names {
+ text-align: center;
+ }
+
+ #change-email {
+ width: 100%;
+ }
+}
diff --git a/app/assets/stylesheets/common/components/navs.scss b/app/assets/stylesheets/common/components/navs.scss
index 188cd681afd..39cbbdbfd18 100644
--- a/app/assets/stylesheets/common/components/navs.scss
+++ b/app/assets/stylesheets/common/components/navs.scss
@@ -64,7 +64,6 @@
.nav-stacked {
@extend %nav;
padding: 0;
- background: var(--primary-low);
li {
border-bottom: 1px solid var(--content-border-color);
diff --git a/app/assets/stylesheets/desktop/_index.scss b/app/assets/stylesheets/desktop/_index.scss
index 31c3f1a8fba..0aa24379e14 100644
--- a/app/assets/stylesheets/desktop/_index.scss
+++ b/app/assets/stylesheets/desktop/_index.scss
@@ -4,4 +4,3 @@
@import "topic";
@import "topic-list";
@import "topic-post";
-@import "user";
diff --git a/app/assets/stylesheets/desktop/user.scss b/app/assets/stylesheets/desktop/user.scss
deleted file mode 100644
index 5e080f9338c..00000000000
--- a/app/assets/stylesheets/desktop/user.scss
+++ /dev/null
@@ -1,187 +0,0 @@
-// Desktop styles for "/user" section
-.user-profile-hidden {
- font-size: 1.5em;
- text-align: center;
-}
-
-.user-secondary-navigation {
- min-width: 150px;
-
- .combo-box {
- width: 100%;
-
- &:not(:last-of-type) {
- margin-bottom: 0.875em;
- }
- }
-
- .nav-stacked {
- background-color: transparent;
- margin: 0;
-
- li {
- border-bottom: none;
-
- &:hover,
- &.active {
- background: var(--primary-very-low);
- }
-
- &.archive {
- padding-left: 1.4em;
- }
- }
- }
-
- .select-kit + .messages-nav {
- margin-top: 1em;
- }
-
- .inboxes-controls {
- margin-bottom: 0.75em;
- }
-
- &.user-messages {
- --left-padding: 0.8em;
-
- .nav-stacked {
- a {
- padding-left: calc(
- var(--left-padding) - 1px
- ); // 1px accounts for border on select-kit elements above
- }
- }
- }
-}
-
-.user-content {
- padding: 0;
- margin-top: 2em;
- padding-bottom: 12px;
- margin-bottom: 12px;
- background: var(--d-content-background, var(--secondary));
- box-sizing: border-box;
-
- .btn.right {
- float: right;
- }
-}
-
-.pref-avatar {
- .avatar {
- max-width: 90px;
- max-height: 90px;
- }
-}
-
-.invite-controls .btn {
- margin-right: 0;
-}
-
-.user-invite-none {
- padding: 15px 0;
-}
-
-.user-main {
- margin-bottom: 50px;
-
- .about {
- &.group {
- .details {
- padding: 15px 0;
- margin: 0;
- color: var(--secondary);
- }
- }
-
- .details {
- img.avatar {
- margin: 0 20px 10px 0;
- }
-
- .primary-textual {
- flex: 0 1 auto;
- padding: 0 0 0.5em;
- }
-
- .bio {
- max-width: 750px;
- }
- }
-
- &.has-background {
- .user-profile-image {
- height: 300px;
- }
-
- .details {
- box-sizing: border-box;
- width: 100%;
- padding: 15px 0 0 0;
- bottom: 0;
- }
- }
-
- .controls {
- align-self: center;
- max-width: 13.5em;
- margin-left: 0.5em;
-
- .btn {
- min-width: 9em;
- width: 100%;
- }
- }
-
- &.collapsed-info {
- .user-profile-image {
- display: none;
- }
-
- .controls {
- display: flex;
- max-width: unset;
- flex: 1 2 min-content;
-
- > ul {
- flex-wrap: wrap;
- margin-left: auto;
- justify-content: end;
- }
- }
-
- .details {
- position: relative;
- padding: 0;
- margin-top: 0;
- border-bottom: 1px solid var(--content-border-color);
- }
- }
- }
-
- .user-field {
- input[type="text"] {
- width: 530px;
- }
-
- .controls {
- .instructions {
- display: block;
- }
- }
- }
-
- .public-user-fields {
- overflow: hidden;
- }
-}
-
-.user-messages-page {
- .topic-list th {
- padding-top: 0;
- }
-
- .show-mores {
- position: absolute;
- }
-}
diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss
index 6b33c1c0a6b..2b24ad3413b 100644
--- a/app/assets/stylesheets/mobile/_index.scss
+++ b/app/assets/stylesheets/mobile/_index.scss
@@ -2,4 +2,3 @@
@import "push-notifications-mobile";
@import "topic-list";
@import "topic-post";
-@import "user";
diff --git a/app/assets/stylesheets/mobile/user.scss b/app/assets/stylesheets/mobile/user.scss
deleted file mode 100644
index a7f63ed828a..00000000000
--- a/app/assets/stylesheets/mobile/user.scss
+++ /dev/null
@@ -1,293 +0,0 @@
-.user-messages-page {
- .paginated-topics-list {
- margin-top: 0;
- }
-
- .show-mores {
- margin-top: 0.5em;
- }
-}
-
-.user-main {
- padding-bottom: 60px; // slightly taller than .footer-nav
-
- .user-content {
- box-sizing: border-box;
- background-color: var(--secondary);
-
- table {
- width: 100%;
- margin-top: 12px;
- }
- }
-
- .about {
- margin-bottom: 0;
- color: var(--secondary);
-
- .secondary {
- dl {
- padding: 8px 0;
- }
- }
-
- .details {
- margin-bottom: 12px;
-
- .user-profile-avatar {
- .avatar-flair {
- right: 2px;
- }
- display: block;
- float: none;
- margin: 8px auto;
-
- img.avatar {
- float: none;
- }
- }
-
- .user-profile-names {
- text-align: center;
- }
-
- .featured-topic {
- text-align: center;
- font-size: var(--font-0);
- }
-
- .location-and-website {
- display: flex;
- flex-wrap: wrap;
- justify-content: center;
- font-size: var(--font-0);
-
- .d-icon {
- width: 0.8em;
- height: 0.8em;
- margin-right: 0.25em;
- }
-
- a {
- text-decoration: underline;
- }
- }
-
- .user-profile-location {
- margin-right: 1em;
- }
-
- .user-profile-location,
- .user-profile-website {
- justify-content: center;
- display: flex;
- align-items: center;
- }
- }
-
- .primary {
- display: flex;
- flex-wrap: wrap;
- color: var(--primary);
-
- .avatar {
- margin: 0 0 12px;
- }
-
- .primary-textual {
- flex: 1 1 100%;
- word-break: break-word;
- margin: 0;
- max-width: 100%;
- }
-
- .bio {
- color: var(--primary);
- margin: 0 auto 8px;
- max-width: 700px;
- text-align: center;
-
- ol {
- margin-left: 25px;
- }
-
- ul,
- ol {
- display: inline-block;
- padding-left: 0;
- text-align: left;
- }
- }
-
- .public-user-fields .public-user-field {
- text-align: center;
- }
- }
-
- &.has-background {
- .user-profile-image {
- height: 200px;
- }
-
- .user-profile-avatar {
- margin-top: -60px;
- }
- }
-
- .controls {
- flex: 1 1 25%;
-
- ul {
- li,
- > span {
- display: flex;
- flex: 1 1 45%;
-
- button,
- a {
- width: 100%;
- }
-
- .select-kit.dropdown-select-box.user-notifications-dropdown {
- width: 100%;
- }
- }
- }
- }
- }
-
- .user-field {
- label {
- width: auto;
- text-align: left;
- font-weight: bold;
- }
- }
-}
-
-.user-main .collapsed-info.about.has-background {
- background-image: none !important; // todo: make changes to behavior to remove this
-
- .details {
- margin-top: 0;
- }
-}
-
-.user-main .collapsed-info.about .details {
- display: flex;
- margin-bottom: 0;
-
- .user-profile-avatar {
- margin: 0;
- flex: 0 0 auto;
- align-self: flex-start;
- }
-
- .primary .primary-textual {
- flex: 1 0 80%;
- margin: 0;
- }
-
- .user-profile-names {
- text-align: left;
- }
-}
-
-.paginated-topics-list {
- margin-top: 20px;
-}
-
-.stats-section {
- li {
- margin: 0 15px 10px 0;
- padding: 0;
-
- &.linked-stat {
- a {
- padding: 0;
- }
- }
- }
-}
-
-.badge-card.medium {
- width: 100%;
-}
-
-.user-preferences {
- padding-bottom: 2em;
-
- .instructions {
- margin-top: 4px;
- }
-
- .controls-dropdown {
- margin-bottom: 16px;
- }
-
- .delete-account {
- overflow: hidden;
- }
-
- .checkbox-label {
- display: flex;
- overflow: auto;
- width: 100%;
- padding: 5px 0;
-
- input {
- margin-right: 5px;
- flex: 0 0 auto;
- }
- }
-
- .apps .controls button {
- float: right;
- }
-
- #change-email {
- width: 100%;
- }
-}
-
-.user-right {
- &,
- > .user-stream {
- > .alert:first-child {
- margin-top: 20px;
- }
- }
-}
-
-.user-invites-page {
- .user-invite-search input {
- width: 100%;
- }
-
- .user-additional-controls {
- width: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
-
- .user-invite-search {
- width: 100%;
- }
- }
-
- .user-invite-none {
- margin-top: 1em;
- }
-}
-
-.second-factor {
- .second-factor-item {
- width: auto;
- display: flex;
- justify-content: space-between;
- }
-
- .details {
- width: 75%;
- }
-}
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-filter.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-filter.gjs
index 3f208619acf..1c8110b99c9 100644
--- a/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-filter.gjs
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/group-assigned-filter.gjs
@@ -14,10 +14,9 @@ const GroupAssignedFilter = <template>
@query={{hash order=@order ascending=@ascending search=@search}}
>
<div class="assign-image">
- <a
- href={{@filter.userPath}}
- data-user-card={{@filter.username}}
- >{{avatar this.filter imageSize="large"}}</a>
+ <a href={{@filter.userPath}} data-user-card={{@filter.username}}>
+ {{avatar @filter imageSize="small"}}
+ </a>
</div>
<div class="assign-names">
diff --git a/plugins/discourse-assign/assets/stylesheets/assigns.scss b/plugins/discourse-assign/assets/stylesheets/assigns.scss
index 752f76e38d2..1ad29317a61 100644
--- a/plugins/discourse-assign/assets/stylesheets/assigns.scss
+++ b/plugins/discourse-assign/assets/stylesheets/assigns.scss
@@ -195,27 +195,31 @@
// a little extra space for long names
min-width: 250px;
- li a {
+ .activity-list {
+ margin-top: 0;
+ }
+
+ li > a {
display: grid;
grid-template-areas: " avatar names count";
grid-template-columns: auto 1fr auto;
align-items: center;
padding: 0.5em 13px;
+ gap: 0.25em;
.assign-image {
- width: 45px;
- margin-right: 0.5em;
+ width: 2em;
text-align: center;
grid-area: avatar;
a {
padding: 0;
- padding-right: 0.5em;
}
svg {
- width: 40px;
- height: 40px;
+ width: 1.5em;
+ height: 1.5em;
+ color: var(--primary-high);
}
}