4a19e0275463b2cf4146f8c72e0d8fc4f8c4749c
[oweals/peertube.git] / client / src / sass / primeng-custom.scss
1 @import '_variables';
2 @import '_mixins';
3
4 @import '~primeng/resources/primeng.css';
5 @import '~primeng/resources/themes/bootstrap/theme.css';
6
7 @mixin glyphicon-light {
8   font-family: 'Glyphicons Halflings';
9   text-decoration: none !important;
10   color: var(--mainForegroundColor) !important;
11 }
12
13 // data table customizations
14 p-table {
15   font-size: 15px !important;
16
17   .ui-table-caption {
18     border: none;
19   }
20
21   td {
22     padding-left: 15px !important;
23
24     &:not(.action-cell) {
25       overflow: hidden !important;
26       text-overflow: ellipsis !important;
27       white-space: nowrap !important;
28     }
29   }
30
31   tr {
32     background-color: var(--mainBackgroundColor) !important;
33     height: 46px;
34
35     &.ui-state-highlight {
36       background-color:var(--submenuColor) !important;
37       color:var(--mainForegroundColor) !important;
38     }
39   }
40
41   .ui-table-tbody {
42     tr {
43       &:hover {
44         background-color: var(--submenuColor) !important;
45       }
46
47       &:not(:hover) {
48         .action-cell * {
49           display: none !important;
50         }
51       }
52
53       &:first-child td {
54         border-top: none !important;
55       }
56
57       &:last-child td {
58         border-bottom: none !important;
59       }
60     }
61
62     .expander {
63       cursor: pointer;
64       position: relative;
65       top: 1px;
66     }
67   }
68
69   th {
70     border: none !important;
71     border-bottom: 1px solid !important;
72     border-color: var(--submenuColor) !important;
73     text-align: left !important;
74     padding: 5px 0 5px 15px !important;
75     font-weight: $font-semibold !important;
76     color: var(--mainForegroundColor) !important;
77
78     &.ui-sortable-column:hover {
79       background-color: var(--submenuColor) !important;
80       border: 1px solid !important;
81       border-color: var(--submenuColor) !important;
82       border-width: 0 1px !important;
83
84       &:first-child {
85         border-width: 0 1px 0 0 !important;
86       }
87     }
88
89     &.ui-state-highlight {
90       background-color:var(--submenuColor) !important;
91
92       .pi {
93         @extend .glyphicon;
94
95         color: #000;
96         font-size: 11px;
97         top: 0;
98
99         &.pi-sort-up {
100           @extend .glyphicon-triangle-top;
101         }
102
103         &.pi-sort-down {
104           @extend .glyphicon-triangle-bottom;
105         }
106       }
107     }
108   }
109
110   .action-cell {
111     width: 250px !important;
112     padding: 0 !important;
113     text-align: center;
114
115     my-edit-button + my-delete-button {
116       margin-left: 5px;
117     }
118   }
119
120   p-paginator {
121     .ui-paginator-bottom {
122       background-color: var(--mainBackgroundColor) !important;
123       position: relative;
124       border: none;
125       border-top: 1px solid !important;
126       border-color: var(--submenuColor) !important;
127       height: 40px;
128       display: flex;
129       justify-content: center;
130       align-items: center;
131
132       .ui-paginator-first,
133       .ui-paginator-prev,
134       .ui-paginator-next,
135       .ui-paginator-last {
136         @include glyphicon-light;
137         padding: 5px 2px;
138         height: auto;
139         outline: none;
140         font-size: 13px;
141         top: -1px;
142
143         &.ui-state-disabled:hover {
144           background-color: #fff !important;
145         }
146
147         &.ui-paginator-first {
148           @extend .glyphicon-step-backward;
149         }
150
151         &.ui-paginator-prev {
152           @extend .glyphicon-chevron-left;
153
154           margin-right: 10px;
155         }
156
157         &.ui-paginator-next {
158           @extend .glyphicon-chevron-right;
159
160           margin-left: 10px;
161         }
162
163         &.ui-paginator-last {
164           @extend .glyphicon-step-forward;
165         }
166       }
167
168       .ui-paginator-pages {
169         height: auto !important;
170
171         a {
172           color: #000 !important;
173           font-weight: $font-semibold !important;
174           margin: 0 10px !important;
175           outline: 0 !important;
176           border-radius: 3px !important;
177           padding: 5px 2px !important;
178           height: auto !important;
179
180           &.ui-state-active {
181             &, &:hover, &:active, &:focus {
182               color: #fff !important;
183               background-color: var(--mainColor) !important;
184             }
185           }
186         }
187       }
188     }
189   }
190 }
191
192 // PrimeNG calendar tweaks
193 p-calendar .ui-datepicker {
194   a {
195     @include disable-default-a-behaviour;
196   }
197
198   .ui-datepicker-header {
199
200     .ui-datepicker-year {
201       margin-left: 5px;
202     }
203
204     .ui-datepicker-next {
205       @extend .glyphicon-chevron-right;
206       @include glyphicon-light;
207     }
208
209     .ui-datepicker-prev {
210       @extend .glyphicon-chevron-left;
211       @include glyphicon-light;
212     }
213   }
214
215   .ui-timepicker {
216
217     .pi.pi-chevron-up {
218       @extend .glyphicon-chevron-up;
219       @include glyphicon-light;
220     }
221
222     .pi.pi-chevron-down {
223       @extend .glyphicon-chevron-down;
224       @include glyphicon-light;
225     }
226   }
227 }
228
229 .ui-chkbox-box {
230   &.ui-state-active {
231     border-color: var(--mainColor) !important;
232     background-color: var(--mainColor) !important;
233   }
234
235   .ui-chkbox-icon {
236     position: relative;
237
238     &:after {
239       content: '';
240       position: absolute;
241       left: 5px;
242       width: 5px;
243       height: 12px;
244       opacity: 0;
245       transform: rotate(45deg) scale(0);
246       border-right: 2px solid var(--mainBackgroundColor);
247       border-bottom: 2px solid var(--mainBackgroundColor);
248     }
249
250     &.pi-check:after {
251       opacity: 1;
252       transform: rotate(45deg) scale(1);
253     }
254   }
255 }