X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fsass%2Fprimeng-custom.scss;h=e288a38669eb9af672bf03820e9ebf4ebda3f32e;hb=c43e50c51c3abff33b1b27db92aa64706cd76c54;hp=afa5778199bce3f5cccd85c01b235a40f207f713;hpb=b0a9743af0273835cdf594431a774c0f7d46b539;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/sass/primeng-custom.scss b/client/src/sass/primeng-custom.scss index afa577819..e288a3866 100644 --- a/client/src/sass/primeng-custom.scss +++ b/client/src/sass/primeng-custom.scss @@ -1,8 +1,19 @@ -@import '_variables'; -@import '_mixins'; +@use '_variables' as *; +@use '_mixins' as *; +@use '_icons' as *; +/* stylelint-disable */ @import '~primeng/resources/primeng.css'; +// Override primeng style we don't want +input[type=button] { + border-radius: inherit; +} + +p-table .p-datatable-header .caption { + margin-bottom: 15px; +} + // Taken from old nova light theme body .p-disabled { @@ -77,9 +88,6 @@ body .p-paginator .p-paginator-current { min-width: 2.286em; line-height: 2.286em; } -body .p-paginator .p-dropdown { - border: 0 none; -} body .p-paginator .p-dropdown .p-dropdown-trigger, body .p-paginator .p-dropdown .p-dropdown-label { color: #848484; } @@ -129,7 +137,8 @@ body .p-paginator .p-paginator-pages .p-paginator-page:focus { box-shadow: 0 0 0 0.2em pvar(--mainColorLightest); } body .p-paginator .p-dropdown { - margin-left: 0.5em; + @include margin-left(0.5em); + height: 2.286em; min-width: auto; } @@ -140,6 +149,7 @@ body .p-dropdown { background: #ffffff; border: 1px solid #a6a6a6; transition: border-color 0.2s, box-shadow 0.2s; + border-radius: 6px; } body .p-dropdown:not(.p-disabled):hover { border-color: #212121; @@ -150,28 +160,41 @@ body .p-dropdown:not(.p-disabled).p-focus { box-shadow: 0 0 0 0.2em pvar(--mainColorLightest); border-color: pvar(--mainColor); } +body .p-dropdown.p-dropdown-clearable .p-dropdown-label { + @include padding-right(0); +} body .p-dropdown .p-dropdown-label { - padding-right: 2em; + background: transparent; + border: 0 none; } +body .p-dropdown .p-dropdown-label.p-placeholder { + color: #6c757d; +} +body .p-dropdown .p-dropdown-label:enabled:focus { + outline: 0 none; + box-shadow: none; +} + body .p-dropdown .p-dropdown-trigger { - background-color: #ffffff; - width: 2em; - line-height: 2em; - text-align: center; - padding: 0; + background-color: transparent; + width: 2rem; + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; color: #848484; } body .p-dropdown .p-dropdown-clear-icon { color: #848484; + right: 2rem; } body .p-dropdown.p-dropdown-clearable .p-dropdown-label { - padding-right: 4em; + @include padding-right(4em); } body .p-dropdown-panel { - padding: 0; - border: 1px solid #c8c8c8; background-color: #ffffff; box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.16); + border: 0 none; + border-radius: 6px; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); } body .p-dropdown-panel .p-dropdown-filter-container { padding: 0.429em 0.857em 0.429em 0.857em; @@ -181,8 +204,9 @@ body .p-dropdown-panel .p-dropdown-filter-container { margin: 0; } body .p-dropdown-panel .p-dropdown-filter-container .p-dropdown-filter { + @include padding-right(2em); + width: 100%; - padding-right: 2em; } body .p-dropdown-panel .p-dropdown-filter-container .p-dropdown-filter-icon { top: 50%; @@ -278,6 +302,9 @@ body .p-datepicker .p-datepicker-header .p-datepicker-title select:focus { outline-offset: 0; box-shadow: 0 0 0 0.2em pvar(--mainColorLightest); } +body .p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-month { + @include margin-right(0.5rem); +} body .p-datepicker table { font-size: 14px; margin: 0.857em 0 0 0; @@ -358,17 +385,18 @@ body .p-datepicker.p-datepicker-timeonly .p-timepicker { border-top: 0 none; } body .p-datepicker.p-datepicker-multiple-month .p-datepicker-group { + @include padding-right(0.857em); + @include padding-left(0.857em); + border-right: 1px solid #d8dae2; - padding-right: 0.857em; - padding-left: 0.857em; padding-top: 0; padding-bottom: 0; } body .p-datepicker.p-datepicker-multiple-month .p-datepicker-group:first-child { - padding-left: 0; + @include padding-left(0); } body .p-datepicker.p-datepicker-multiple-month .p-datepicker-group:last-child { - padding-right: 0; + @include padding-right(0); border-right: 0 none; } body .p-calendar.p-calendar-w-btn .p-inputtext { @@ -392,7 +420,7 @@ body p-calendar.ng-dirty.ng-invalid > .p-calendar > .p-inputtext { border: 1px solid #a80000; } body .p-timepicker .p-separator { - margin-left: 0; + @include margin-left(0); min-width: 0.75rem; } @@ -431,84 +459,27 @@ body p-autocomplete.ng-dirty.ng-invalid > .p-autocomplete > .p-inputtext { border: 1px solid #a80000; } -// select button -body .p-selectbutton .p-button { - background-color: #dadada; - border: 1px solid #dadada; - color: #333333; - overflow: hidden; - transition: background-color 0.2s, box-shadow 0.2s; -} -body .p-selectbutton .p-button .p-button-icon-left { - color: #666666; -} -body .p-selectbutton .p-button:not(.p-disabled):not(.p-highlight):hover { - background-color: #c8c8c8; - border-color: #c8c8c8; - color: #333333; -} -body .p-selectbutton .p-button:not(.p-disabled):not(.p-highlight):hover .p-button-icon-left { - color: #212121; -} -body .p-selectbutton .p-button:not(.p-disabled):not(.p-highlight).ui-state-focus { - box-shadow: 0 0 0 0.2em #8dcdff; - z-index: 1; -} -body .p-selectbutton .p-button.p-highlight { - background-color: pvar(--mainColor); - border-color: pvar(--mainColor); - color: #ffffff; -} -body .p-selectbutton .p-button.p-highlight .p-button-icon-left { - color: #ffffff; -} -body .p-selectbutton .p-button.p-highlight:not(.p-disabled):hover { - background-color: pvar(--mainColorLighter); - border-color: pvar(--mainColorLighter); - color: #ffffff; -} -body .p-selectbutton .p-button.p-highlight:not(.p-disabled):hover .p-button-icon-left { - color: #ffffff; -} -body .p-selectbutton .p-button:first-child { - border-top-left-radius: 3px; - border-bottom-left-radius: 3px; -} -body .p-selectbutton .p-button:last-child { - border-top-right-radius: 3px; - border-bottom-right-radius: 3px; -} -body p-selectbutton.ng-dirty.ng-invalid .p-button { - border: 1px solid #a80000; -} - -// - -@mixin glyphicon-light { - font-family: 'Glyphicons Halflings'; - text-decoration: none !important; - color: pvar(--mainForegroundColor) !important; - font-display: swap; -} +// --------------------------------------------------------------------------- +// PeerTube customizations +// --------------------------------------------------------------------------- -// data table customizations p-table { + table { + table-layout: fixed; + } + .p-datatable-header { border: none !important; background-color: pvar(--mainBackgroundColor) !important; .caption { - height: 40px; + min-height: 40px; width: 100%; display: inline-flex; align-items: center; .left-buttons { - padding-left: 15px; - } - - .input-group-text { - background-color: transparent; + @include padding-left(15px); } } } @@ -523,12 +494,12 @@ p-table { td, th { font-family: $main-fonts; - font-size: 15px !important; + font-size: 15px; color: pvar(--mainForegroundColor) !important; } td { - padding-left: 15px !important; + @include padding-left(15px !important); &.expand-cell { padding: 10px 15px; @@ -547,7 +518,7 @@ p-table { height: 46px; &.p-highlight { - background-color: pvar(--submenuColor) !important; + background-color: pvar(--submenuBackgroundColor) !important; td, td > a { color: pvar(--mainForegroundColor) !important; @@ -558,7 +529,7 @@ p-table { .p-datatable-tbody { tr { &:hover { - background-color: pvar(--submenuColor) !important; + background-color: pvar(--submenuBackgroundColor) !important; } td { @@ -588,46 +559,40 @@ p-table { } th { + @include padding-left(15px); + @include padding-right(0px); + + padding-top: 5px !important; + padding-bottom: 5px !important; + border: none !important; border-bottom: 1px solid !important; - border-color: pvar(--submenuColor) !important; - text-align: left !important; - padding: 5px 0 5px 15px !important; + border-color: pvar(--submenuBackgroundColor) !important; + text-align: start !important; font-weight: $font-semibold !important; color: pvar(--mainForegroundColor) !important; &.p-sortable-column:hover { - background-color: pvar(--submenuColor) !important; - border: 1px solid !important; - border-color: pvar(--submenuColor) !important; - border-width: 0 1px !important; - - &:first-child { - border-width: 0 1px 0 0 !important; - } + background-color: pvar(--submenuBackgroundColor) !important; } &.p-highlight { - background-color: pvar(--submenuColor) !important; - - .pi { - @extend .glyphicon; + background-color: pvar(--submenuBackgroundColor) !important; - color: #000 !important; - font-size: 11px !important; - top: 0 !important; - - &.pi-sort-amount-up-alt { - @extend .glyphicon-triangle-top; - - color: pvar(--mainForegroundColor) !important; - } + .pi-sort-amount-up-alt, + .pi-sort-amount-down { + display: inline-block; + position: relative; + top: -1px; + color: pvar(--mainForegroundColor) !important; + } - &.pi-sort-amount-down { - @extend .glyphicon-triangle-bottom; + .pi-sort-amount-up-alt { + @include arrow-up(5px); + } - color: pvar(--mainForegroundColor) !important; - } + .pi-sort-amount-down { + @include arrow-down(5px); } } } @@ -640,10 +605,10 @@ p-table { my-delete-button, my-button { display: inline-block !important; - margin-left: 5px; + @include margin-left(5px); &:first-child { - margin-left: 0 + @include margin-left(0) } } } @@ -654,16 +619,18 @@ p-table { position: relative; border: none; border-top: 1px solid !important; - border-color: pvar(--submenuColor) !important; + border-color: pvar(--submenuBackgroundColor) !important; height: 40px; display: flex; justify-content: center; align-items: center; - .p-dropdown { - position: absolute; - top: 10px; - left: 0; + p-dropdown { + .p-dropdown { + @include padding-left(0.5rem); + + align-items: center; + } &.p-focus { box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest); @@ -674,23 +641,33 @@ p-table { } } + .p-dropdown, + .p-dropdown-trigger { + color: pvar(--mainForegroundColor); + background-color: pvar(--mainBackgroundColor); + } + .p-paginator-current { - position: absolute; - right: 0; color: pvar(--inputPlaceholderColor); overflow: visible; } + .p-paginator-first { + margin-left: auto; + } + + .p-paginator-last { + margin-right: auto; + } + .p-paginator-first, .p-paginator-prev, .p-paginator-next, .p-paginator-last { - @include glyphicon-light; padding: 5px 2px; - height: auto; + height: 100%; outline: none; - font-size: 13px; - top: -1px; + color: pvar(--mainForegroundColor); &.focus-within, &:focus { @@ -701,24 +678,17 @@ p-table { background-color: #fff !important; } - &.p-paginator-first { - @extend .glyphicon-step-backward; + .p-paginator-icon { + width: 18px; + height: 18px; } &.p-paginator-prev { - @extend .glyphicon-chevron-left; - - margin-right: 10px; + @include margin-right(10px); } &.p-paginator-next { - @extend .glyphicon-chevron-right; - - margin-left: 10px; - } - - &.p-paginator-last { - @extend .glyphicon-step-forward; + @include margin-left(10px); } } @@ -750,88 +720,37 @@ p-table { } } } -} - -// overflow data table -@mixin overflow-datatable ($table-min-width, $horizontal-margins, $mobile-paginator: true) { - p-table { - .p-datatable-wrapper { - overflow-x: auto; - max-width: calc(100vw - #{$horizontal-margins * 2}); - - table { - min-width: $table-min-width; - } - } - @if $mobile-paginator { - p-paginator .p-paginator-bottom { - display: block; - - .p-paginator-current { - position: relative; - display: block; - } - - a, .p-paginator-pages { - vertical-align: middle; - } - } - } + .pt-badge { + font-size: 12px; + text-transform: uppercase; } } -// PrimeNG calendar tweaks -p-calendar .p-datepicker { - a { - @include disable-default-a-behaviour; - } - - .p-datepicker-header { - - .p-datepicker-year { - margin-left: 5px; - } - - .p-datepicker-next { - @extend .glyphicon-chevron-right; - @include glyphicon-light; - - color: #000 !important; - text-align: right; +// overflow data table +p-table { + .p-datatable-wrapper { + overflow-x: auto; + max-width: 100%; - .pi.pi-chevron-right { - display: none !important; - } + table { + width: 100%; } + } - .p-datepicker-prev { - @extend .glyphicon-chevron-left; - @include glyphicon-light; - - color: #000 !important; - text-align: left; - - .pi.pi-chevron-left { + @media screen and (max-width: $small-view) { + p-paginator { + .p-paginator-current { display: none !important; } } } - .p-timepicker { - - .pi.pi-chevron-up { - @extend .glyphicon-chevron-up; - @include glyphicon-light; - - color: #000 !important; - } - - .pi.pi-chevron-down { - @extend .glyphicon-chevron-down; - @include glyphicon-light; - - color: #000 !important; + @media screen and (max-width: $mobile-view) { + p-paginator { + .p-paginator-pages > .p-paginator-page:not(.p-highlight) { + display: none; + } } } } @@ -849,31 +768,9 @@ p-tablecheckbox:hover div .p-checkbox-box { .p-checkbox-box { &.p-highlight { - border-color: pvar(--mainColor) !important; + color: pvar(--mainBackgroundColor) !important; background-color: pvar(--mainColor) !important; - } - - .p-checkbox-icon { - position: relative; - overflow: visible !important; - - &:after { - content: ''; - position: absolute; - bottom: -5px; - left: -2px; - width: 5px; - height: 12px; - opacity: 0; - transform: rotate(45deg) scale(0); - border-right: 2px solid pvar(--mainBackgroundColor); - border-bottom: 2px solid pvar(--mainBackgroundColor); - } - - &.pi-check:after { - opacity: 1; - transform: rotate(45deg) scale(1); - } + border-color: pvar(--mainColor) !important; } } } @@ -883,18 +780,16 @@ p-toast { width: auto; max-width: 300px; min-width: 200px; - z-index: z(notification) !important; .p-toast-icon-close { - font-family: "Glyphicons Halflings"; opacity: 0; position: absolute; right: 5px; top: 5px; - - &:after { - content: "\e014"; - } + width: 18px; + height: 18px; + background: url('../assets/images/feather/x.svg') no-repeat; + background-size: contain; } &:hover .p-toast-icon-close { @@ -912,22 +807,6 @@ p-toast { box-shadow: 0 2px 12px 0 rgba(0, 0 , 0, .1); overflow: hidden; - &.p-toast-message-success .glyphicon { - color: #8BC34A !important; - } - - &.p-toast-message-error .glyphicon { - color: #F44336 !important; - } - - &.p-toast-message-warn .glyphicon { - color: #F1680D !important; - } - - &.p-toast-message-info .glyphicon { - color: #03A9F4 !important; - } - .notification-block { display: flex; align-items: center; @@ -935,35 +814,73 @@ p-toast { padding: 10px 20px; .message { + @include margin-right(20px); + flex-grow: 1; - margin-right: 20px; h3 { font-size: 21px; } p { - font-size: 15px; + @include peertube-word-wrap; + margin-bottom: 0; } } - - .glyphicon { - font-size: 32px; - margin-right: 5px; - } } } + + .p-toast-message-success my-global-icon { + color: #8BC34A !important; + } + + .p-toast-message-error my-global-icon { + color: #F44336 !important; + } + + .p-toast-message-warn my-global-icon { + color: #F1680D !important; + } + + .p-toast-message-info my-global-icon { + color: #03A9F4 !important; + } } -.p-selectbutton { - .p-button:focus { - outline: none; +@media screen and (max-width: $primeng-breakpoint) { + p-table { + td { + padding: 3px 0; + + &.expand-cell { + padding: 5px; + } + } + + .p-datatable-tbody { + + td:last-child { + padding-bottom: 15px; + margin-bottom: 15px; + border-bottom: 1px solid $separator-border-color !important; + } + } } +} - .p-button-label { - padding: 5px 15px; - font-size: 15px; - font-weight: 600; +@media screen and (max-width: $mobile-view) { + p-table { + .p-datatable-header { + .caption { + flex-wrap: wrap; + + > div { + width: 100%; + padding: 0 !important; + margin-bottom: 5px; + } + } + } } }