diff --git a/src/components/user_card/user_card.scss b/src/components/user_card/user_card.scss index 4ce5ac36e..8376548be 100644 --- a/src/components/user_card/user_card.scss +++ b/src/components/user_card/user_card.scss @@ -64,20 +64,40 @@ } .background-image { - position: absolute; - inset: 0; - right: -1.2em; - left: -1.2em; - top: -1.4em; + width: calc(100% + 2.4em); + margin-left: -1.2em; + margin-right: -1.2em; + margin-top: -3.4em; + margin-bottom: -4.5em; + aspect-ratio: 3; padding: 0; - mask: linear-gradient(to top, transparent 0, white 5em) bottom no-repeat; + inset: 0; + mask: + linear-gradient(to top, white 0%, transparent 20%) bottom no-repeat, + linear-gradient(to top, white 0%, white 100%); + // Autoprefixer seem to ignore this one, and also syntax is different + /* stylelint-disable mask-composite */ + /* stylelint-disable declaration-property-value-no-unknown */ + /* stylelint-disable scss/declaration-property-value-no-unknown */ + + /* TODO check if this is still needed */ + mask-composite: xor; + /* stylelint-enable scss/declaration-property-value-no-unknown */ + /* stylelint-enable declaration-property-value-no-unknown */ + /* stylelint-enable mask-composite */ + mask-composite: exclude; background-size: cover; + mask-size: 100%; border-top-left-radius: calc(var(--__roundnessTop, --panelRadius) - 1px); border-top-right-radius: calc(var(--__roundnessTop, --panelRadius) - 1px); border-bottom-left-radius: calc(var(--__roundnessBottom, --panelRadius) - 1px); border-bottom-right-radius: calc(var(--__roundnessBottom, --panelRadius) - 1px); background-color: var(--profileBg); z-index: -2; + + &.hide-bio { + mask-size: 100% 40px; + } } &-bio { @@ -132,8 +152,6 @@ text-align: right; .user-identity { - position: relative; - aspect-ratio: 3; min-width: 0; display: flex; align-items: flex-end; @@ -167,10 +185,8 @@ display: inline-grid; grid-auto-flow: column; grid-gap: 0.6em; - flex: 1; font-size: 110%; z-index: 2; - align-self: end; a, button, div { text-align: center; @@ -219,9 +235,7 @@ } .user-summary { - align-self: stretch; - display: flex; - flex-direction: column; + display: block; margin-left: 0.6em; text-align: left; text-overflow: ellipsis; @@ -241,8 +255,6 @@ .top-line { display: flex; - flex-direction: column; - flex: 1; // these two normalize position and height when custom emoji are used line-height: 2; margin-bottom: -0.2em; @@ -264,6 +276,7 @@ .user-screen-name { color: var(--text); + min-width: 5em; text-overflow: ellipsis; overflow: hidden; display: inline-block; @@ -278,6 +291,7 @@ .user-name { text-overflow: ellipsis; overflow: hidden; + flex: 1 1 auto; margin-right: 1em; font-size: 1.1em; } diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 4b859c9d7..3c2a5c2cc 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -5,12 +5,63 @@ >