X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fsass%2Finclude%2F_mixins.scss;h=b2083e51653d3445e4745e062f22178cd43a7536;hb=c27463a603186b623500b03c6a56b330a6568350;hp=bf844ac5dffe190441c63085ce9d098d041760a9;hpb=cdeddff142fd20f8cb8bb346625909d61c596603;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss index bf844ac5d..b2083e516 100644 --- a/client/src/sass/include/_mixins.scss +++ b/client/src/sass/include/_mixins.scss @@ -1,7 +1,9 @@ @import '_variables'; @mixin disable-default-a-behaviour { - &:hover, &:focus, &:active { + &:hover, + &:focus, + &:active { text-decoration: none !important; outline: none !important; } @@ -22,7 +24,7 @@ @mixin ellipsis-multiline($font-size: 16px, $number-of-lines: 2) { display: block; /* Fallback for non-webkit */ - display: -webkit-box; + display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */ -webkit-line-clamp: $number-of-lines; /* Fallback for non-webkit */ font-size: $font-size; @@ -36,7 +38,7 @@ position: relative; overflow: hidden; - &:after { + &::after { content: ''; pointer-events: none; width: 100%; @@ -48,11 +50,14 @@ } } -@mixin peertube-word-wrap { +@mixin peertube-word-wrap ($with-hyphen: true) { word-break: break-word; word-wrap: break-word; overflow-wrap: break-word; - hyphens: auto; + + @if $with-hyphen { + hyphens: auto; + } } @mixin apply-svg-color ($color) { @@ -109,9 +114,9 @@ padding-bottom: 0; flex-wrap: nowrap; - .input-group-text{ + .input-group-text { font-size: 14px; - color: gray; + color: #808080; } } @@ -128,7 +133,9 @@ @mixin orange-button { @include button-focus(pvar(--mainColorLightest)); - &, &:active, &:focus { + &, + &:active, + &:focus { color: #fff; background-color: pvar(--mainColor); } @@ -138,14 +145,15 @@ background-color: pvar(--mainHoverColor); } - &[disabled], &.disabled { + &[disabled], + &.disabled { cursor: default; color: #fff; background-color: #C6C6C6; } my-global-icon { - @include apply-svg-color(#fff) + @include apply-svg-color(#fff); } } @@ -155,7 +163,9 @@ border: 2px solid pvar(--mainColor); font-weight: $font-semibold; - &, &:active, &:focus { + &, + &:active, + &:focus { color: pvar(--mainColor); background-color: pvar(--mainBackgroundColor); } @@ -165,14 +175,15 @@ background-color: pvar(--mainColorLightest); } - &[disabled], &.disabled { + &[disabled], + &.disabled { cursor: default; color: pvar(--mainColor); background-color: #C6C6C6; } my-global-icon { - @include apply-svg-color(pvar(--mainColor)) + @include apply-svg-color(pvar(--mainColor)); } } @@ -182,12 +193,13 @@ color: pvar(--greyForegroundColor); background-color: transparent; - &[disabled], &.disabled { + &[disabled], + .disabled { cursor: default; } my-global-icon { - @include apply-svg-color(transparent) + @include apply-svg-color(transparent); } } @@ -197,17 +209,22 @@ background-color: $grey-background-color; color: pvar(--greyForegroundColor); - &:hover, &:active, &:focus, &[disabled], &.disabled { + &:hover, + &:active, + &:focus, + &[disabled], + &.disabled { color: pvar(--greyForegroundColor); background-color: $grey-background-hover-color; } - &[disabled], &.disabled { + &[disabled], + &.disabled { cursor: default; } my-global-icon { - @include apply-svg-color(pvar(--greyForegroundColor)) + @include apply-svg-color(pvar(--greyForegroundColor)); } } @@ -216,47 +233,53 @@ $text: #fff6f5; @include button-focus(scale-color($color, $alpha: -95%)); + background-color: $color; color: $text; - &:hover, &:active, &:focus, &[disabled], &.disabled { + &:hover, + &:active, + &:focus, + &[disabled], + &.disabled { background-color: lighten($color: $color, $amount: 10); } - &[disabled], &.disabled { + &[disabled], + &.disabled { cursor: default; } my-global-icon { - @include apply-svg-color($text) + @include apply-svg-color($text); } } @mixin peertube-button { - border: none; + border: 0; font-weight: $font-semibold; font-size: 15px; height: $button-height; line-height: $button-height; - border-radius: 3px; + // FIXME: because of primeng that redefines border-radius of all input[type="..."] + border-radius: 3px !important; text-align: center; padding: 0 17px 0 13px; cursor: pointer; } @mixin peertube-button-link { - display: inline-block; - @include disable-default-a-behaviour; @include peertube-button; -} -@mixin peertube-button-outline { display: inline-block; +} +@mixin peertube-button-outline { @include disable-default-a-behaviour; @include peertube-button; + display: inline-block; border: 1px solid; } @@ -290,17 +313,17 @@ filter: alpha(opacity=0); opacity: 0; outline: none; - background: white; + background: #fff; cursor: inherit; display: block; } } @mixin peertube-button-file ($width) { - width: $width; - @include peertube-file; @include peertube-button; + + width: $width; } @mixin icon ($size) { @@ -316,7 +339,7 @@ @mixin select-arrow-down { top: 50%; right: calc(0% + 15px); - content: " "; + content: ' '; height: 0; width: 0; position: absolute; @@ -357,7 +380,7 @@ width: 100%; } - &:after { + &::after { @include select-arrow-down; } @@ -393,21 +416,21 @@ option { font-weight: $font-semibold; color: pvar(--greyForegroundColor); - border: none; + border: 0; } } } // Thanks: https://codepen.io/triss90/pen/XNEdRe/ @mixin peertube-radio-container { - input[type="radio"] { + input[type=radio] { display: none; - & + label { + + label { font-weight: $font-regular; cursor: pointer; - &:before { + &::before { position: relative; top: -2px; content: ''; @@ -424,12 +447,12 @@ } } - &:checked + label:before { + &:checked + label::before { background-color: #000; box-shadow: inset 0 0 0 4px #fff; } - &:focus + label:before { + &:focus + label::before { outline: none; border-color: #000; } @@ -444,7 +467,7 @@ box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest); } - & + span { + + span { position: relative; width: 18px; min-width: 18px; @@ -454,7 +477,7 @@ vertical-align: middle; cursor: pointer; - &:after { + &::after { content: ''; position: absolute; top: calc(2px - #{$border-width}); @@ -473,13 +496,13 @@ background: pvar(--mainColor); animation: jelly 0.6s ease; - &:after { + &::after { opacity: 1; transform: rotate(45deg) scale(1); } } - & + span + span { + + span + span { font-size: 15px; font-weight: $font-regular; margin-left: 5px; @@ -488,7 +511,7 @@ } &[disabled] + span, - &[disabled] + span + span{ + &[disabled] + span + span { opacity: 0.5; cursor: default; } @@ -538,21 +561,12 @@ } } -@mixin avatar ($size) { - object-fit: cover; - border-radius: 50%; - width: $size; - height: $size; - min-width: $size; - min-height: $size; -} - -@mixin channel-avatar ($size) { +@mixin actor-avatar-size ($size) { + display: inline-block; width: $size; height: $size; min-width: $size; min-height: $size; - border-radius: 5px; } @mixin chevron ($size, $border-width) { @@ -594,26 +608,6 @@ margin-bottom: 10px; } -@mixin actor-owner { - @include disable-default-a-behaviour; - - font-size: 13px; - margin-top: 4px; - color: pvar(--mainForegroundColor); - - span:hover { - opacity: 0.8; - } - - img { - @include avatar(18px); - - margin-left: 7px; - position: relative; - top: -2px; - } -} - @mixin create-button { @include peertube-button-link; @include orange-button; @@ -713,13 +707,13 @@ color: pvar(--mainColor); } - & + .breadcrumb-item { + + .breadcrumb-item { padding-left: 0.5rem; &::before { display: inline-block; padding-right: 0.5rem; color: #6c757d; - content: "/"; + content: '/'; } } @@ -734,13 +728,13 @@ flex-wrap: wrap; margin: 0 -5px; - & > div { + > div { box-sizing: border-box; flex: 0 0 percentage(1/3); padding: 0 5px; margin-bottom: 10px; - & > a { + > a { @include disable-default-a-behaviour; text-decoration: none; @@ -755,8 +749,8 @@ } } - & > a, - & > div { + > a, + > div { padding: 20px; background: pvar(--submenuBackgroundColor); border-radius: 4px; @@ -765,7 +759,8 @@ } } - .dashboard-num, .dashboard-text { + .dashboard-num, + .dashboard-text { text-align: center; font-size: 130%; color: pvar(--mainForegroundColor); @@ -829,17 +824,9 @@ --chip-padding: .2rem .3rem; } - .avatar { + my-actor-avatar { margin-left: -.4rem; margin-right: .2rem; - height: $avatar-height; - width: $avatar-height; - - border-radius: 50%; - display: inline-block; - line-height: 1.25; - position: relative; - vertical-align: middle; } &.two-lines { @@ -847,9 +834,8 @@ height: $avatar-height; - .avatar { - height: $avatar-height; - width: $avatar-height; + my-actor-avatar { + @include actor-avatar-size($avatar-height); } div { @@ -867,7 +853,7 @@ flex-direction: column; .form-sub-title { - margin-right: 0px !important; + margin-right: 0 !important; margin-bottom: 10px; text-align: center; } @@ -913,15 +899,17 @@ padding-bottom: 15px; margin-bottom: $sub-menu-margin-bottom; - my-global-icon { + > span > my-global-icon, + > my-global-icon { margin-right: 10px; - vertical-align: bottom; width: 24px; height: 24px; + vertical-align: top; } .badge { margin-left: 7px; + vertical-align: top; } } }