codecheck
695 строк · 18.2 Кб
1// core
2.p-button {
3display: inline-flex;
4cursor: pointer;
5user-select: none;
6align-items: center;
7vertical-align: bottom;
8text-align: center;
9overflow: hidden;
10position: relative;
11}
12
13.p-button-label {
14flex: 1 1 auto;
15}
16
17.p-button-icon-right {
18order: 1;
19}
20
21.p-button:disabled {
22cursor: default;
23}
24
25.p-button-icon-only {
26justify-content: center;
27}
28
29.p-button-icon-only .p-button-label {
30visibility: hidden;
31width: 0;
32flex: 0 0 auto;
33}
34
35.p-button-vertical {
36flex-direction: column;
37}
38
39.p-button-icon-bottom {
40order: 2;
41}
42
43.p-button-group .p-button {
44margin: 0;
45}
46
47.p-button-group .p-button:not(:last-child), .p-button-group .p-button:not(:last-child):hover {
48border-right: 0 none;
49}
50
51.p-button-group .p-button:not(:first-of-type):not(:last-of-type) {
52border-radius: 0;
53}
54
55.p-button-group .p-button:first-of-type:not(:only-of-type) {
56border-top-right-radius: 0;
57border-bottom-right-radius: 0;
58}
59
60.p-button-group .p-button:last-of-type:not(:only-of-type) {
61border-top-left-radius: 0;
62border-bottom-left-radius: 0;
63}
64
65.p-button-group .p-button:focus {
66position: relative;
67z-index: 1;
68}
69
70// theme
71.p-button {
72color: $buttonTextColor;
73background: $buttonBg;
74border: $buttonBorder;
75padding: $buttonPadding;
76font-size: $fontSize;
77transition: $formElementTransition;
78border-radius: $borderRadius;
79outline-color: transparent;
80
81&:not(:disabled):hover {
82background: $buttonHoverBg;
83color: $buttonTextHoverColor;
84border-color: $buttonHoverBorderColor;
85}
86
87&:not(:disabled):active {
88background: $buttonActiveBg;
89color: $buttonTextActiveColor;
90border-color: $buttonActiveBorderColor;
91}
92
93&.p-button-outlined {
94background-color: transparent;
95color: $buttonBg;
96border: $outlinedButtonBorder;
97
98&:not(:disabled):hover {
99background: rgba($buttonBg, $textButtonHoverBgOpacity);
100color: $buttonBg;
101border: $outlinedButtonBorder;
102}
103
104&:not(:disabled):active {
105background: rgba($buttonBg, $textButtonActiveBgOpacity);
106color: $buttonBg;
107border: $outlinedButtonBorder;
108}
109
110&.p-button-plain {
111color: $plainButtonTextColor;
112border-color: $plainButtonTextColor;
113
114&:not(:disabled):hover {
115background: $plainButtonHoverBgColor;
116color: $plainButtonTextColor;
117}
118
119&:not(:disabled):active {
120background: $plainButtonActiveBgColor;
121color: $plainButtonTextColor;
122}
123}
124}
125
126&.p-button-text {
127background-color: transparent;
128color: $buttonBg;
129border-color: transparent;
130
131&:not(:disabled):hover {
132background: rgba($buttonBg, $textButtonHoverBgOpacity);
133color: $buttonBg;
134border-color: transparent;
135}
136
137&:not(:disabled):active {
138background: rgba($buttonBg, $textButtonActiveBgOpacity);
139color: $buttonBg;
140border-color: transparent;
141}
142
143&.p-button-plain {
144color: $plainButtonTextColor;
145
146&:not(:disabled):hover {
147background: $plainButtonHoverBgColor;
148color: $plainButtonTextColor;
149}
150
151&:not(:disabled):active {
152background: $plainButtonActiveBgColor;
153color: $plainButtonTextColor;
154}
155}
156}
157
158&:focus-visible {
159@include focused();
160}
161
162.p-button-label {
163transition-duration: $transitionDuration;
164}
165
166.p-button-icon-left {
167margin-right: $inlineSpacing;
168}
169
170.p-button-icon-right {
171margin-left: $inlineSpacing;
172}
173
174.p-button-icon-bottom {
175margin-top: $inlineSpacing;
176}
177
178.p-button-icon-top {
179margin-bottom: $inlineSpacing;
180}
181
182.p-badge {
183margin-left: $inlineSpacing;
184min-width: $fontSize;
185height: $fontSize;
186line-height: $fontSize;
187color: $buttonBg;
188background-color: $buttonTextColor;
189}
190
191&.p-button-raised {
192box-shadow: $raisedButtonShadow;
193}
194
195&.p-button-rounded {
196border-radius: $roundedButtonBorderRadius;
197}
198
199&.p-button-icon-only {
200width: $buttonIconOnlyWidth;
201padding: $buttonIconOnlyPadding;
202
203.p-button-icon-left,
204.p-button-icon-right {
205margin: 0;
206}
207
208&.p-button-rounded {
209border-radius: 50%;
210height: $buttonIconOnlyWidth;
211}
212}
213
214&.p-button-sm {
215@include scaledFontSize($fontSize, $scaleSM);
216@include scaledPadding($buttonPadding, $scaleSM);
217
218.p-button-icon {
219@include scaledFontSize($primeIconFontSize, $scaleSM);
220}
221}
222
223&.p-button-lg {
224@include scaledFontSize($fontSize, $scaleLG);
225@include scaledPadding($buttonPadding, $scaleLG);
226
227.p-button-icon {
228@include scaledFontSize($primeIconFontSize, $scaleLG);
229}
230}
231
232&.p-button-loading-label-only {
233.p-button-label {
234margin-left: $inlineSpacing;
235}
236
237.p-button-loading-icon {
238margin-right: 0;
239}
240}
241}
242
243.p-fluid {
244.p-button {
245width: 100%;
246}
247
248.p-button-icon-only {
249width: $buttonIconOnlyWidth;
250}
251
252.p-button-group {
253display: flex;
254
255.p-button {
256flex: 1;
257}
258}
259}
260
261.p-button.p-button-secondary, .p-button-group.p-button-secondary > .p-button, .p-splitbutton.p-button-secondary > .p-button {
262color: $secondaryButtonTextColor;
263background: $secondaryButtonBg;
264border: $secondaryButtonBorder;
265
266&:not(:disabled):hover {
267background: $secondaryButtonHoverBg;
268color: $secondaryButtonTextHoverColor;
269border-color: $secondaryButtonHoverBorderColor;
270}
271
272&:not(:disabled):focus {
273box-shadow: $secondaryButtonFocusShadow;
274}
275
276&:not(:disabled):active {
277background: $secondaryButtonActiveBg;
278color: $secondaryButtonTextActiveColor;
279border-color: $secondaryButtonActiveBorderColor;
280}
281
282&.p-button-outlined {
283background-color: transparent;
284color: $secondaryButtonBg;
285border: $outlinedButtonBorder;
286
287&:not(:disabled):hover {
288background: rgba($secondaryButtonBg, $textButtonHoverBgOpacity);
289color: $secondaryButtonBg;
290border: $outlinedButtonBorder;
291}
292
293&:not(:disabled):active {
294background: rgba($secondaryButtonBg, $textButtonActiveBgOpacity);
295color: $secondaryButtonBg;
296border: $outlinedButtonBorder;
297}
298}
299
300&.p-button-text {
301background-color: transparent;
302color: $secondaryButtonBg;
303border-color: transparent;
304
305&:not(:disabled):hover {
306background: rgba($secondaryButtonBg, $textButtonHoverBgOpacity);
307border-color: transparent;
308color: $secondaryButtonBg;
309}
310
311&:not(:disabled):active {
312background: rgba($secondaryButtonBg, $textButtonActiveBgOpacity);
313border-color: transparent;
314color: $secondaryButtonBg;
315}
316}
317}
318
319.p-button.p-button-info, .p-button-group.p-button-info > .p-button, .p-splitbutton.p-button-info > .p-button {
320color: $infoButtonTextColor;
321background: $infoButtonBg;
322border: $infoButtonBorder;
323
324&:not(:disabled):hover {
325background: $infoButtonHoverBg;
326color: $infoButtonTextHoverColor;
327border-color: $infoButtonHoverBorderColor;
328}
329
330&:not(:disabled):focus {
331box-shadow: $infoButtonFocusShadow;
332}
333
334&:not(:disabled):active {
335background: $infoButtonActiveBg;
336color: $infoButtonTextActiveColor;
337border-color: $infoButtonActiveBorderColor;
338}
339
340&.p-button-outlined {
341background-color: transparent;
342color: $infoButtonBg;
343border: $outlinedButtonBorder;
344
345&:not(:disabled):hover {
346background: rgba($infoButtonBg, $textButtonHoverBgOpacity);
347color: $infoButtonBg;
348border: $outlinedButtonBorder;
349}
350
351&:not(:disabled):active {
352background: rgba($infoButtonBg, $textButtonActiveBgOpacity);
353color: $infoButtonBg;
354border: $outlinedButtonBorder;
355}
356}
357
358&.p-button-text {
359background-color: transparent;
360color: $infoButtonBg;
361border-color: transparent;
362
363&:not(:disabled):hover {
364background: rgba($infoButtonBg, $textButtonHoverBgOpacity);
365border-color: transparent;
366color: $infoButtonBg;
367}
368
369&:not(:disabled):active {
370background: rgba($infoButtonBg, $textButtonActiveBgOpacity);
371border-color: transparent;
372color: $infoButtonBg;
373}
374}
375}
376
377.p-button.p-button-success, .p-button-group.p-button-success > .p-button, .p-splitbutton.p-button-success > .p-button {
378color: $successButtonTextColor;
379background: $successButtonBg;
380border: $successButtonBorder;
381
382&:not(:disabled):hover {
383background: $successButtonHoverBg;
384color: $successButtonTextHoverColor;
385border-color: $successButtonHoverBorderColor;
386}
387
388&:not(:disabled):focus {
389box-shadow: $successButtonFocusShadow;
390}
391
392&:not(:disabled):active {
393background: $successButtonActiveBg;
394color: $successButtonTextActiveColor;
395border-color: $successButtonActiveBorderColor;
396}
397
398&.p-button-outlined {
399background-color: transparent;
400color: $successButtonBg;
401border: $outlinedButtonBorder;
402
403&:not(:disabled):hover {
404background: rgba($successButtonBg, $textButtonHoverBgOpacity);
405color: $successButtonBg;
406border: $outlinedButtonBorder;
407}
408
409&:not(:disabled):active {
410background: rgba($successButtonBg, $textButtonActiveBgOpacity);
411color: $successButtonBg;
412border: $outlinedButtonBorder;
413}
414}
415
416&.p-button-text {
417background-color: transparent;
418color: $successButtonBg;
419border-color: transparent;
420
421&:not(:disabled):hover {
422background: rgba($successButtonBg, $textButtonHoverBgOpacity);
423border-color: transparent;
424color: $successButtonBg;
425}
426
427&:not(:disabled):active {
428background: rgba($successButtonBg, $textButtonActiveBgOpacity);
429border-color: transparent;
430color: $successButtonBg;
431}
432}
433}
434
435.p-button.p-button-warning, .p-button-group.p-button-warning > .p-button, .p-splitbutton.p-button-warning > .p-button {
436color: $warningButtonTextColor;
437background: $warningButtonBg;
438border: $warningButtonBorder;
439
440&:not(:disabled):hover {
441background: $warningButtonHoverBg;
442color: $warningButtonTextHoverColor;
443border-color: $warningButtonHoverBorderColor;
444}
445
446&:not(:disabled):focus {
447box-shadow: $warningButtonFocusShadow;
448}
449
450&:not(:disabled):active {
451background: $warningButtonActiveBg;
452color: $warningButtonTextActiveColor;
453border-color: $warningButtonActiveBorderColor;
454}
455
456&.p-button-outlined {
457background-color: transparent;
458color: $warningButtonBg;
459border: $outlinedButtonBorder;
460
461&:not(:disabled):hover {
462background: rgba($warningButtonBg, $textButtonHoverBgOpacity);
463color: $warningButtonBg;
464border: $outlinedButtonBorder;
465}
466
467&:not(:disabled):active {
468background: rgba($warningButtonBg, $textButtonActiveBgOpacity);
469color: $warningButtonBg;
470border: $outlinedButtonBorder;
471}
472}
473
474&.p-button-text {
475background-color: transparent;
476color: $warningButtonBg;
477border-color: transparent;
478
479&:not(:disabled):hover {
480background: rgba($warningButtonBg, $textButtonHoverBgOpacity);
481border-color: transparent;
482color: $warningButtonBg;
483}
484
485&:not(:disabled):active {
486background: rgba($warningButtonBg, $textButtonActiveBgOpacity);
487border-color: transparent;
488color: $warningButtonBg;
489}
490}
491}
492
493.p-button.p-button-help, .p-button-group.p-button-help > .p-button, .p-splitbutton.p-button-help > .p-button {
494color: $helpButtonTextColor;
495background: $helpButtonBg;
496border: $helpButtonBorder;
497
498&:not(:disabled):hover {
499background: $helpButtonHoverBg;
500color: $helpButtonTextHoverColor;
501border-color: $helpButtonHoverBorderColor;
502}
503
504&:not(:disabled):focus {
505box-shadow: $helpButtonFocusShadow;
506}
507
508&:not(:disabled):active {
509background: $helpButtonActiveBg;
510color: $helpButtonTextActiveColor;
511border-color: $helpButtonActiveBorderColor;
512}
513
514&.p-button-outlined {
515background-color: transparent;
516color: $helpButtonBg;
517border: $outlinedButtonBorder;
518
519&:not(:disabled):hover {
520background: rgba($helpButtonBg, $textButtonHoverBgOpacity);
521color: $helpButtonBg;
522border: $outlinedButtonBorder;
523}
524
525&:not(:disabled):active {
526background: rgba($helpButtonBg, $textButtonActiveBgOpacity);
527color: $helpButtonBg;
528border: $outlinedButtonBorder;
529}
530}
531
532&.p-button-text {
533background-color: transparent;
534color: $helpButtonBg;
535border-color: transparent;
536
537&:not(:disabled):hover {
538background: rgba($helpButtonBg, $textButtonHoverBgOpacity);
539border-color: transparent;
540color: $helpButtonBg;
541}
542
543&:not(:disabled):active {
544background: rgba($helpButtonBg, $textButtonActiveBgOpacity);
545border-color: transparent;
546color: $helpButtonBg;
547}
548}
549}
550
551.p-button.p-button-danger, .p-button-group.p-button-danger > .p-button, .p-splitbutton.p-button-danger > .p-button {
552color: $dangerButtonTextColor;
553background: $dangerButtonBg;
554border: $dangerButtonBorder;
555
556&:not(:disabled):hover {
557background: $dangerButtonHoverBg;
558color: $dangerButtonTextHoverColor;
559border-color: $dangerButtonHoverBorderColor;
560}
561
562&:not(:disabled):focus {
563box-shadow: $dangerButtonFocusShadow;
564}
565
566&:not(:disabled):active {
567background: $dangerButtonActiveBg;
568color: $dangerButtonTextActiveColor;
569border-color: $dangerButtonActiveBorderColor;
570}
571
572&.p-button-outlined {
573background-color: transparent;
574color: $dangerButtonBg;
575border: $outlinedButtonBorder;
576
577&:not(:disabled):hover {
578background: rgba($dangerButtonBg, $textButtonHoverBgOpacity);
579color: $dangerButtonBg;
580border: $outlinedButtonBorder;
581}
582
583&:not(:disabled):active {
584background: rgba($dangerButtonBg, $textButtonActiveBgOpacity);
585color: $dangerButtonBg;
586border: $outlinedButtonBorder;
587}
588}
589
590&.p-button-text {
591background-color: transparent;
592color: $dangerButtonBg;
593border-color: transparent;
594
595&:not(:disabled):hover {
596background: rgba($dangerButtonBg, $textButtonHoverBgOpacity);
597border-color: transparent;
598color: $dangerButtonBg;
599}
600
601&:not(:disabled):active {
602background: rgba($dangerButtonBg, $textButtonActiveBgOpacity);
603border-color: transparent;
604color: $dangerButtonBg;
605}
606}
607}
608
609@if variable-exists(contrastButtonTextColor) {
610.p-button.p-button-contrast, .p-button-group.p-button-contrast > .p-button, .p-splitbutton.p-button-contrast > .p-button {
611color: $contrastButtonTextColor;
612background: $contrastButtonBg;
613border: $contrastButtonBorder;
614
615&:not(:disabled):hover {
616background: $contrastButtonHoverBg;
617color: $contrastButtonTextHoverColor;
618border-color: $contrastButtonHoverBorderColor;
619}
620
621&:not(:disabled):focus {
622box-shadow: $contrastButtonFocusShadow;
623}
624
625&:not(:disabled):active {
626background: $contrastButtonActiveBg;
627color: $contrastButtonTextActiveColor;
628border-color: $contrastButtonActiveBorderColor;
629}
630
631&.p-button-outlined {
632background-color: transparent;
633color: $contrastButtonBg;
634border: $outlinedButtonBorder;
635
636&:not(:disabled):hover {
637background: rgba($contrastButtonBg, $textButtonHoverBgOpacity);
638color: $contrastButtonBg;
639border: $outlinedButtonBorder;
640}
641
642&:not(:disabled):active {
643background: rgba($contrastButtonBg, $textButtonActiveBgOpacity);
644color: $contrastButtonBg;
645border: $outlinedButtonBorder;
646}
647}
648
649&.p-button-text {
650background-color: transparent;
651color: $contrastButtonBg;
652border-color: transparent;
653
654&:not(:disabled):hover {
655background: rgba($contrastButtonBg, $textButtonHoverBgOpacity);
656border-color: transparent;
657color: $contrastButtonBg;
658}
659
660&:not(:disabled):active {
661background: rgba($contrastButtonBg, $textButtonActiveBgOpacity);
662border-color: transparent;
663color: $contrastButtonBg;
664}
665}
666}
667}
668
669.p-button.p-button-link {
670color: $linkButtonColor;
671background: transparent;
672border: transparent;
673
674&:not(:disabled):hover {
675background: transparent;
676color: $linkButtonHoverColor;
677border-color: transparent;
678
679.p-button-label {
680text-decoration: $linkButtonTextHoverDecoration;
681}
682}
683
684&:not(:disabled):focus {
685background: transparent;
686box-shadow: $linkButtonFocusShadow;
687border-color: transparent;
688}
689
690&:not(:disabled):active {
691background: transparent;
692color: $linkButtonColor;
693border-color: transparent;
694}
695}
696