profile.css (5188B)
1 /* 2 GoToSocial 3 Copyright (C) 2021-2023 GoToSocial Authors admin@gotosocial.org 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU Affero General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU Affero General Public License for more details. 14 15 You should have received a copy of the GNU Affero General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 .page { 20 grid-template-columns: 1fr minmax(auto, 60rem) 1fr; /* fallback for lack of min() support */ 21 grid-template-columns: 1fr min(92%, 65rem) 1fr; 22 } 23 24 .profile { 25 padding: 0.5rem; 26 border-radius: $br; 27 28 .column-split { 29 display: flex; 30 flex-wrap: wrap; 31 gap: 1rem; 32 } 33 } 34 35 .profile .header { 36 background: $profile-bg; 37 border-radius: $br; 38 overflow: hidden; 39 margin-bottom: 1rem; 40 41 .header-image { 42 position: relative; 43 padding-top: 33.33%; /* aspect-ratio 1/3 */ 44 45 img { 46 position: absolute; 47 top: 0; 48 left: 0; 49 right: 0; 50 width: 100%; 51 height: 100%; 52 object-fit: cover; 53 } 54 } 55 56 /* 57 Basic info container has the user's avatar, display- and username, and role 58 It's partially overlapped over the header image, by a negative margin-top 59 */ 60 $avatar-size: 8.5rem; 61 $name-size: 3rem; 62 $username-size: 2rem; 63 64 $overlap: calc($avatar-size - $name-size - $username-size); 65 66 .basic-info { 67 position: relative; 68 display: grid; 69 box-sizing: border-box; 70 grid-template-columns: $avatar-size auto 1fr; 71 grid-template-rows: $overlap $name-size auto; 72 grid-template-areas: 73 "avatar . ." 74 "avatar displayname displayname" 75 "avatar username role"; 76 77 margin: 1rem; 78 margin-top: calc(-1 * $overlap); 79 gap: 0 1rem; 80 81 .avatar { 82 grid-area: avatar; 83 height: $avatar-size; 84 width: $avatar-size; 85 border: 0.2rem solid $avatar-border; 86 border-radius: $br; 87 overflow: hidden; /* prevents image extending beyond rounded borders */ 88 89 img { 90 height: 100%; 91 width: 100%; 92 object-fit: cover; 93 } 94 } 95 96 .displayname { 97 grid-area: displayname; 98 line-height: $name-size; 99 font-size: 1.5rem; 100 font-weight: bold; 101 } 102 103 .username { 104 min-width: 0; 105 grid-area: username; 106 line-height: $username-size; 107 108 font-size: 1rem; 109 font-weight: bold; 110 color: $fg-accent; 111 user-select: all; 112 } 113 114 .role { 115 background: $bg; 116 color: $fg; 117 border: 0.13rem solid $bg; 118 119 grid-area: role; 120 align-self: center; 121 justify-self: start; 122 border-radius: $br; 123 padding: 0.3rem; 124 125 line-height: 1.1rem; 126 font-size: 0.9rem; 127 font-variant: small-caps; 128 font-weight: bold; 129 130 &.admin { 131 color: $role-admin; 132 border-color: $role-admin; 133 } 134 135 &.moderator { 136 color: $role-mod; 137 border-color: $role-mod; 138 } 139 } 140 } 141 } 142 143 @media screen and (max-width: 750px) { 144 .profile .header { 145 .basic-info { 146 grid-template-columns: auto 1fr; 147 grid-template-rows: $avatar-size $name-size auto; 148 grid-template-areas: 149 "avatar avatar" 150 "displayname displayname" 151 "username role"; 152 153 .displayname { 154 font-size: 1.4rem; 155 } 156 } 157 } 158 } 159 160 .profile .col-header { 161 display: flex; 162 justify-content: start; 163 gap: 2rem; 164 align-items: center; 165 166 margin: 0; 167 background: $profile-bg; 168 border-top-left-radius: $br; 169 border-top-right-radius: $br; 170 padding: 0.75rem; 171 172 h1, h2 { 173 font-size: 1.2rem; 174 line-height: 1.3rem; 175 margin: 0; 176 } 177 } 178 179 .profile .toots { 180 flex: 65 25rem; 181 display: flex; 182 flex-direction: column; 183 gap: 0.4rem; 184 185 .col-header { 186 display: grid; 187 grid-template-columns: auto 1fr; 188 gap: 1rem; 189 190 a { 191 justify-self: end; 192 } 193 194 .rss-icon { 195 display: block; 196 margin: -0.25rem 0; 197 198 .fa { 199 font-size: 2rem; 200 object-fit: contain; 201 vertical-align: middle; 202 color: $orange2; 203 /* can't size a single-color background, so we use a linear-gradient that's effectively white */ 204 background: linear-gradient(to right, $white1 100%, transparent 0) no-repeat center center; 205 background-size: 1.2rem 1.4rem; 206 } 207 } 208 } 209 210 .toot { 211 border-radius: 0; 212 213 .info { 214 padding: 0.3rem 0.75rem; 215 } 216 217 &:last-child { 218 border-bottom-left-radius: $br; 219 border-bottom-right-radius: $br; 220 } 221 } 222 223 .backnextlinks { 224 display: flex; 225 justify-content: space-between; 226 227 .next { 228 margin-left: auto; 229 } 230 } 231 } 232 233 .profile .about-user { 234 flex: 35 14rem; 235 border-radius: $br; 236 overflow: hidden; 237 238 .col-header { 239 margin-bottom: -0.25rem; 240 } 241 242 .fields { 243 background: $profile-bg; 244 display: flex; 245 flex-direction: column; 246 padding: 0 0.5rem; 247 padding-top: 0.25rem; 248 249 .field { 250 padding: 0.25rem; 251 display: flex; 252 flex-direction: column; 253 border-bottom: 0.1rem solid $gray2; 254 255 &:first-child { 256 border-top: 0.1rem solid $gray2; 257 } 258 } 259 } 260 261 .bio { 262 background: $profile-bg; 263 padding: 1rem 0.75rem; 264 padding-bottom: 1.25rem; 265 } 266 267 .accountstats { 268 background: $bg-accent; 269 padding: 0.75rem; 270 271 display: grid; 272 grid-template-columns: auto 1fr; 273 gap: 0.25rem 1rem; 274 } 275 }