]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Refactoring accounts component style
authorWicklow <wicklow@framasoft.org>
Fri, 17 Feb 2023 11:21:14 +0000 (12:21 +0100)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 20 Feb 2023 12:52:22 +0000 (13:52 +0100)
client/src/app/+accounts/account-video-channels/account-video-channels.component.html
client/src/app/+accounts/account-video-channels/account-video-channels.component.scss
client/src/app/+accounts/accounts.component.html
client/src/app/+accounts/accounts.component.scss
client/src/sass/include/_account-channel-page.scss

index 38293b070612e43d38b3cf9a0b1036bdf0d46c1f..e3b4997737fc7e8190b72ea79d8c5391c4f49a11 100644 (file)
@@ -16,7 +16,7 @@
           size="75"
         ></my-actor-avatar>
 
-        <h2>
+        <h2 class="fs-5 lh-1 fw-bold m-0">
           <a [routerLink]="getVideoChannelLink(videoChannel)" i18n-title title="See this video channel">
             {{ videoChannel.displayName }}
           </a>
@@ -39,7 +39,7 @@
 
       <div class="videos-overflow-workaround">
         <div class="videos">
-          <div class="no-results" i18n *ngIf="getTotalVideosOf(videoChannel) === 0">This channel doesn't have any videos.</div>
+          <div class="no-results h-auto" i18n *ngIf="getTotalVideosOf(videoChannel) === 0">This channel doesn't have any videos.</div>
 
           <my-video-miniature
             *ngFor="let video of getVideosOf(videoChannel)"
index 11ed4c3b1c1463a8d4e5c47238f89155342b044d..2e34ed71c78b06eff05d4b1215d4781ff521864b 100644 (file)
@@ -8,11 +8,11 @@
 }
 
 .channel {
+  @include rfs(2rem, padding);
+  @include rfs(2rem 0, margin);
+
   max-width: $max-channels-width;
   background-color: pvar(--channelBackgroundColor);
-  padding: 30px;
-
-  margin: 30px 0;
 
   display: grid;
   grid-template-columns: 1fr auto;
   h2 {
     grid-row: 1;
     grid-column: 2;
-    font-size: 20px;
-    line-height: 1;
-    font-weight: $font-bold;
-    margin: 0;
   }
 
   .actor-counters {
@@ -87,13 +83,11 @@ my-subscribe-button {
     max-width: $video-thumbnail-medium-width;
   }
 
-  .no-results {
-    height: auto;
-  }
 }
 
 .videos-overflow-workaround {
-  margin-top: 30px;
+  @include margin-top(2rem);
+  
   overflow-x: hidden;
 }
 
index 226fa8f3121929ef95a53478da6a83f1a20471c7..116b26a4da3dcd7a4e373d24644a33bec9bf114e 100644 (file)
@@ -1,5 +1,5 @@
 <div *ngIf="account" class="root">
-  <div class="account-info">
+  <div class="account-info d-md-grid d-block">
 
     <div class="account-avatar-row">
       <my-actor-avatar class="main-avatar" actorType="account" [actor]="account"></my-actor-avatar>
@@ -9,11 +9,11 @@
 
         <div class="actor-info">
           <div>
-            <div class="actor-display-name">
+            <div class="actor-display-name align-items-center">
               <h1 i18n-title [title]="'Created on ' + (account.createdAt | date)">{{ account.displayName }}</h1>
 
               <my-user-moderation-dropdown
-                [prependActions]="prependModerationActions"
+                class="mx-3" prependActions]="prependModerationActions"
                 buttonSize="small" [account]="account" [user]="accountUser" placement="bottom-left auto"
                 (userChanged)="onUserChanged()" (userDeleted)="onUserDeleted()"
               ></my-user-moderation-dropdown>
@@ -48,7 +48,7 @@
       <div class="description-html" [innerHTML]="accountDescriptionHTML"></div>
     </div>
 
-    <div *ngIf="hasShowMoreDescription()" class="show-more" role="button"
+    <div *ngIf="hasShowMoreDescription()" class="show-more d-md-none d-block" role="button"
       (click)="accountDescriptionExpanded = !accountDescriptionExpanded"
       title="Show the complete description" i18n-title i18n
     >
index e5f86e61ec71be35a673515de1b9b8e43c955891..331008f8ab028a9424e601503f305129f2bd2017 100644 (file)
@@ -4,10 +4,8 @@
 @use '_miniature' as *;
 
 .root {
-  --myGlobalTopPadding: 60px;
-  --myImgMargin: 30px;
-  --myFontSize: 16px;
-  --myGreyFontSize: 16px;
+  --myFontSize: 1rem;
+  --myGreyFontSize: 1rem;
 }
 
 .section-label {
   }
 }
 
-my-user-moderation-dropdown {
-  margin: 0 10px;
-
-  height: fit-content;
-}
-
 .copy-button {
   @include margin-left(3px);
 
@@ -48,20 +40,19 @@ my-user-moderation-dropdown {
 
 .account-info {
   @include grid-videos-miniature-margins(false, 15px);
+  @include padding-top(3.75rem);
+  @include padding-bottom(3.75rem);
+  @include margin-bottom(3rem);
+  @include font-size(1rem);
 
-  display: grid;
   grid-template-columns: 1fr min-content;
   grid-template-rows: auto auto;
 
   background-color: pvar(--submenuBackgroundColor);
-  margin-bottom: 45px;
-  padding-top: var(--myGlobalTopPadding);
-  padding-bottom: var(--myGlobalTopPadding);
-  font-size: var(--myFontSize);
 }
 
 .account-avatar-row {
-  @include avatar-row-responsive(var(--myImgMargin), var(--myGreyFontSize));
+  @include avatar-row-responsive(2rem, var(--myGreyFontSize));
 }
 
 .actor-display-name {
@@ -76,8 +67,8 @@ my-user-moderation-dropdown {
 
 .show-more {
   @include show-more-description;
+  @include padding-bottom(3.75rem);
 
-  display: none;
   text-align: center;
 }
 
@@ -90,11 +81,11 @@ my-user-moderation-dropdown {
   justify-content: flex-end;
   align-content: flex-start;
 
-  > *:not(:last-child) {
-    margin-bottom: 15px;
+  >*:not(:last-child) {
+    @include margin-bottom(1rem);
   }
 
-  > a {
+  >a {
     white-space: nowrap;
   }
 }
@@ -104,15 +95,6 @@ my-user-moderation-dropdown {
 }
 
 @media screen and (max-width: $small-view) {
-  .root {
-    --myGlobalTopPadding: 45px;
-    --myChannelImgMargin: 15px;
-  }
-
-  .account-info {
-    display: block;
-    padding-bottom: 60px;
-  }
 
   .description:not(.expanded) {
     @include fade-text(30px, pvar(--submenuBackgroundColor));
@@ -120,10 +102,6 @@ my-user-moderation-dropdown {
     max-height: 70px;
   }
 
-  .show-more {
-    display: block;
-  }
-
   .buttons {
     justify-content: center;
   }
@@ -131,22 +109,12 @@ my-user-moderation-dropdown {
 
 @media screen and (max-width: $mobile-view) {
   .root {
-    --myGlobalTopPadding: 15px;
-    --myFontSize: 14px;
-    --myGreyFontSize: 13px;
-  }
-
-  .account-info {
-    display: block;
-    padding-bottom: 30px;
+    --myFontSize: $font-size-rem-14px;
+    --myGreyFontSize: $font-size-rem-13px;
   }
 
   .links {
     margin: auto !important;
     width: min-content;
   }
-
-  .show-more {
-    margin-bottom: 30px;
-  }
-}
+}
\ No newline at end of file
index f05b8169e5cea87cc378cfd564ae3b48f76180a5..ab6c772c159c1eba0c9d68dbe8dd766647f04076 100644 (file)
 }
 
 @mixin show-more-description {
+  @include rfs(10px auto 45px, margin);
+  
   color: pvar(--mainColor);
   cursor: pointer;
-  margin: 10px auto 45px;
 }
 
 @mixin avatar-row-responsive ($img-margin, $grey-font-size) {
+  @include margin-bottom(2rem);
+
   display: flex;
   grid-column: 1;
-  margin-bottom: 30px;
 
   > div {
     @include margin-left($img-margin);
@@ -49,7 +51,8 @@
   }
 
   h1 {
-    font-size: 28px;
+    @include font-size(2rem);
+
     font-weight: $font-bold;
     margin: 0;
   }
@@ -60,8 +63,9 @@
 
   .actor-handle,
   .actor-counters {
+    @include font-size($grey-font-size);
+
     color: pvar(--greyForegroundColor);
-    font-size: $grey-font-size;
   }
 
   .actor-counters > *:not(:last-child)::after {
   }
 
   @media screen and (max-width: $mobile-view) {
-    margin-bottom: 15px;
-
-    h1 {
-      font-size: 22px;
-    }
 
     .main-avatar {
       @include actor-avatar-size(80px);