codecheck
100 строк · 2.4 Кб
1// core
2.p-togglebutton {3position: relative;4display: inline-flex;5user-select: none;6vertical-align: bottom;7}
8
9.p-togglebutton-input {10cursor: pointer;11}
12
13.p-togglebutton .p-button {14flex: 1 1 auto;15}
16
17// theme
18.p-togglebutton {19.p-togglebutton-input {20appearance: none;21position: absolute;22top: 0;23left: 0;24width: 100%;25height: 100%;26padding: 0;27margin: 0;28opacity: 0;29z-index: 1;30outline: 0 none;31border: $toggleButtonBorder;32border-radius: $borderRadius;33}34
35.p-button {36background: $toggleButtonBg;37border: $toggleButtonBorder;38color: $toggleButtonTextColor;39transition: $formElementTransition;40outline-color: transparent;41
42.p-button-icon-left,43.p-button-icon-right {44color: $toggleButtonIconColor;45}46}47
48&.p-highlight {49.p-button {50background: $toggleButtonActiveBg;51border-color: $toggleButtonActiveBorderColor;52color: $toggleButtonTextActiveColor;53
54.p-button-icon-left,55.p-button-icon-right {56color: $toggleButtonIconActiveColor;57}58}59}60
61&:not(.p-disabled) {62&:has(.p-togglebutton-input:hover) {63&:not(.p-highlight) {64.p-button {65background: $toggleButtonHoverBg;66border-color: $toggleButtonHoverBorderColor;67color: $toggleButtonTextHoverColor;68
69.p-button-icon-left,70.p-button-icon-right {71color: $toggleButtonIconHoverColor;72}73}74}75
76&.p-highlight {77.p-button {78background: $toggleButtonActiveHoverBg;79border-color: $toggleButtonActiveHoverBorderColor;80color: $toggleButtonTextActiveHoverColor;81
82.p-button-icon-left,83.p-button-icon-right {84color: $toggleButtonIconActiveHoverColor;85}86}87}88}89
90&:has(.p-togglebutton-input:focus-visible) {91.p-button {92@include focused-input();93}94}95}96
97&.p-invalid > .p-button {98@include invalid-input();99}100}