Skip to content

Commit

Permalink
Merge pull request primefaces#126 from primefaces/issue-125
Browse files Browse the repository at this point in the history
Issue 125 - Add variant styles
  • Loading branch information
cetincakiroglu committed Apr 30, 2024
2 parents 965646e + 1be9481 commit f875d90
Show file tree
Hide file tree
Showing 13 changed files with 189 additions and 6 deletions.
22 changes: 22 additions & 0 deletions theme-base/components/data/_tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@
color: $textColor;
}
}

&.p-variant-filled {
.p-checkbox-box {
background-color: $inputFilledBg;

&.p-highlight {
background: $checkboxActiveBg;
}
}

&:not(.p-disabled) {
.p-checkbox-box {
&:hover {
background-color: $inputFilledHoverBg;
}

&.p-highlight:hover {
background: $checkboxActiveHoverBg;
}
}
}
}
}

&.p-highlight {
Expand Down
22 changes: 22 additions & 0 deletions theme-base/components/data/_treetable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,28 @@
color: $textColor;
}
}

&.p-variant-filled {
.p-checkbox-box {
background-color: $inputFilledBg;

&.p-highlight {
background: $checkboxActiveBg;
}
}

&:not(.p-disabled) {
.p-checkbox-box {
&:hover {
background-color: $inputFilledHoverBg;
}

&.p-highlight:hover {
background: $checkboxActiveHoverBg;
}
}
}
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions theme-base/components/input/_cascadeselect.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@
&.p-invalid.p-component {
@include invalid-input();
}

&.p-variant-filled {
background-color: $inputFilledBg;

&:enabled:hover {
background-color: $inputFilledHoverBg;
}

&:enabled:focus {
background-color: $inputFilledFocusBg;
}
}
}

.p-cascadeselect-panel {
Expand Down
24 changes: 22 additions & 2 deletions theme-base/components/input/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@
}
}
}

&.p-variant-filled {
.p-checkbox-box {
background-color: $inputFilledBg;

&.p-highlight {
background: $checkboxActiveBg;
}
}

&:not(.p-checkbox-disabled) {
.p-checkbox-box {
&:hover {
background-color: $inputFilledHoverBg;
}

&.p-highlight:hover {
background: $checkboxActiveHoverBg;
}
}
}
}
}

p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
Expand All @@ -61,13 +83,11 @@ p-checkbox.ng-dirty.ng-invalid > .p-checkbox > .p-checkbox-box {
background: $checkboxActiveBg;
}
}

&:not(.p-checkbox-disabled) {
.p-checkbox-box {
&:hover {
background-color: $inputFilledHoverBg;
}

&.p-highlight:hover {
background: $checkboxActiveHoverBg;
}
Expand Down
12 changes: 12 additions & 0 deletions theme-base/components/input/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
&.p-invalid.p-component {
@include invalid-input();
}

&.p-variant-filled {
background-color: $inputFilledBg;

&:enabled:hover {
background-color: $inputFilledHoverBg;
}

&:enabled:focus {
background-color: $inputFilledFocusBg;
}
}
}

.p-dropdown-panel {
Expand Down
14 changes: 14 additions & 0 deletions theme-base/components/input/_inputmask.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,18 @@ p-inputmask.p-inputmask-clearable {
color: $inputIconColor;
right: nth($inputPadding, 2);
}
}

.p-inputmask {
&.p-variant-filled {
background-color: $inputFilledBg;

&:enabled:hover {
background-color: $inputFilledHoverBg;
}

&:enabled:focus {
background-color: $inputFilledFocusBg;
}
}
}
14 changes: 14 additions & 0 deletions theme-base/components/input/_inputnumber.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,18 @@ p-inputnumber.p-inputnumber-clearable {
right: $buttonIconOnlyWidth + nth($inputPadding, 2);
}
}
}

p-inputnumber.p-inputnumber {
&.p-variant-filled > .p-inputnumber-input {
background-color: $inputFilledBg;

&:enabled:hover {
background-color: $inputFilledHoverBg;
}

&:enabled:focus {
background-color: $inputFilledFocusBg;
}
}
}
12 changes: 12 additions & 0 deletions theme-base/components/input/_inputtext.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
@include invalid-input();
}

&.p-variant-filled {
background-color: $inputFilledBg;

&:enabled:hover {
background-color: $inputFilledHoverBg;
}

&:enabled:focus {
background-color: $inputFilledFocusBg;
}
}

&.p-inputtext-sm {
@include scaledFontSize($inputTextFontSize, $scaleSM);
@include scaledPadding($inputPadding, $scaleSM);
Expand Down
11 changes: 11 additions & 0 deletions theme-base/components/input/_multiselect.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
border-bottom-right-radius: $borderRadius;
}

&.p-variant-filled {
background: $inputFilledBg;

&:not(.p-disabled):hover {
background-color: $inputFilledHoverBg;
}

&:not(.p-disabled).p-focus {
background-color: $inputFilledFocusBg;
}
}
}

.p-inputwrapper-filled {
Expand Down
18 changes: 18 additions & 0 deletions theme-base/components/input/_radiobutton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@
}
}
}

&.p-variant-filled {
.p-radiobutton-box {
background-color: $inputFilledBg;

&:not(.p-disabled):hover {
background-color: $inputFilledHoverBg;
}

&.p-highlight {
background: $radiobuttonActiveBg;

&:not(.p-disabled):hover {
background: $radiobuttonActiveHoverBg;
}
}
}
}
}

p-radiobutton.ng-dirty.ng-invalid > .p-radiobutton > .p-radiobutton-box {
Expand Down
12 changes: 12 additions & 0 deletions theme-base/components/input/_treeselect.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
border-top-right-radius: $borderRadius;
border-bottom-right-radius: $borderRadius;
}

&.p-variant-filled {
background-color: $inputFilledBg;

&:enabled:hover {
background-color: $inputFilledHoverBg;
}

&:enabled:focus {
background-color: $inputFilledFocusBg;
}
}
}

p-treeselect.ng-invalid.ng-dirty > .p-treeselect {
Expand Down
6 changes: 2 additions & 4 deletions themes/material/extensions/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@
box-shadow: 0 0 1px 10px rgba($checkboxActiveBg, .12);
}
}
}

.p-input-filled {
.p-checkbox {
&.p-variant-filled {
.p-checkbox-box {
background-color: $inputBg;

&:not(.p-disabled):hover {
background-color: $inputBg;
}
Expand Down
16 changes: 16 additions & 0 deletions themes/material/extensions/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@
&:not(.p-disabled).p-focus {
box-shadow: inset 0 0 0 1px $inputFocusBorderColor,inset 0 0 0 1px $inputFocusBorderColor,inset 0 0 0 1px $inputFocusBorderColor,inset 0 0 0 1px $inputFocusBorderColor;
}

&.p-variant-filled {
background: $inputFilledBg;

&:not(.p-disabled):hover {
background-color: $inputFilledHoverBg;
}

&:not(.p-disabled).p-focus {
background-color: $inputFilledFocusBg;

.p-inputtext {
background-color: transparent;
}
}
}
}

.p-dropdown-item {
Expand Down

0 comments on commit f875d90

Please sign in to comment.