Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 28 additions & 25 deletions src/assets/scss/components/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,26 @@
)
);

&.control {
display: inline-flex;
align-items: center;

.control-label {
padding-left: css.getVar("control-padding-horizontal");
padding-right: css.getVar("control-padding-horizontal");
cursor: pointer;
}
}

.check {
outline: none;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: none;
cursor: pointer;
font-size: inherit;
width: vars.$checkbox-size;
height: vars.$checkbox-size;
width: css.getVar("checkbox-size");
height: css.getVar("checkbox-size");
flex-shrink: 0;
border-radius: css.getVar("checkbox-border-radius");
border: css.getVar("checkbox-border-width") solid
Expand Down Expand Up @@ -73,33 +87,22 @@
}
}

.control-label {
padding-left: css.getVar("control-padding-horizontal");
}

&.button {
display: flex;
}

&.is-disabled {
opacity: 0.5;
cursor: not-allowed;
}
color: css.getVar("input-disabled-color");

// size variants

@include controls.control;

&.is-small {
@include controls.control-small;
}

&.is-medium {
@include controls.control-medium;
&,
input[disabled],
.control-label {
cursor: unset;
}
}

&.is-large {
@include controls.control-large;
// size variants
@each $name, $value in vars.$sizes-map {
&.is-#{$name} {
font-size: #{$value};
}
}

// variant colors
Expand Down
51 changes: 29 additions & 22 deletions src/assets/scss/components/_radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,37 @@

@include mixins.unselectable;

&.control {
display: inline-flex;
align-items: center;

.control-label {
padding-left: css.getVar("control-padding-horizontal");
padding-right: css.getVar("control-padding-horizontal");
cursor: pointer;
}
}

.check {
outline: none;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
// font-size is changed by user agent to lower size
outline: none;
cursor: pointer;
font-size: inherit;
width: css.getVar("radio-size");
height: css.getVar("radio-size");
flex-shrink: 0;
border-radius: 50%;
border-radius: 50% !important;
border: 2px solid css.getVar("radio-border-color");
transition: background vars.$speed-slow css.getVar("easing");
box-shadow: css.getVar("radio-shadow");

&:before {
content: "";
position: absolute;
left: calc(css.getVar("radio-size") * 0.55);
top: calc(css.getVar("radio-size") * 0.45);
left: 0;
top: 0;
width: css.getVar("radio-size");
height: css.getVar("radio-size");
border-radius: 50%;
Expand Down Expand Up @@ -76,28 +89,22 @@
}
}

.control-label {
padding-left: css.getVar("control-padding-horizontal");
}

&.is-disabled {
opacity: 0.5;
}
color: css.getVar("input-disabled-color");

// sizes

@include controls.control;

&.is-small {
@include controls.control-small;
}

&.is-medium {
@include controls.control-medium;
&,
input[disabled],
.control-label {
cursor: unset;
}
}

&.is-large {
@include controls.control-large;
// size variants
@each $name, $value in vars.$sizes-map {
&.is-#{$name} {
font-size: #{$value};
}
}

// variant colors
Expand Down
54 changes: 24 additions & 30 deletions src/assets/scss/components/_switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,27 @@

@include mixins.unselectable;

cursor: pointer;
&.control {
display: inline-flex;
align-items: center;

.control-label {
padding-left: css.getVar("control-padding-horizontal");
padding-right: css.getVar("control-padding-horizontal");
cursor: pointer;
}
}

input[type="checkbox"] {
.check {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: none;
cursor: pointer;
display: flex;
align-items: center;
flex-shrink: 0;
font-size: inherit;
width: css.getVar("switch-width");
padding: css.getVar("switch-padding");
flex-shrink: 0;
background: css.getVar("switch-background-color");
border-radius: css.getVar("radius");
transition:
Expand Down Expand Up @@ -110,22 +118,17 @@

&.has-left-label {
flex-direction: row-reverse;

.control-label {
padding-right: css.getVar("control-padding-horizontal");
}
}

&:not(.has-left-label) {
.control-label {
padding-left: css.getVar("control-padding-horizontal");
}
}

&.is-disabled {
opacity: 0.5;
cursor: not-allowed;
color: css.getVar("input-disabled-color");

&,
input[disabled],
.control-label {
cursor: unset;
}
}

&.is-rounded input {
Expand All @@ -136,20 +139,11 @@
}
}

// sizes

@include controls.control;

&.is-small {
@include controls.control-small;
}

&.is-medium {
@include controls.control-medium;
}

&.is-large {
@include controls.control-large;
// size variants
@each $name, $value in vars.$sizes-map {
&.is-#{$name} {
font-size: #{$value};
}
}

// variant colors
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
},
input: {
override: true,
rootClass: (_: string, props: Record<string, any>) => {

Check warning on line 22 in src/plugins/theme.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected any. Specify a different type
const classes = ["control"];
if (isTrueish(props.icon)) classes.push("has-icons-left");
return classes.join(" ");
},
inputClass: (_: string, props: Record<string, any>) => {

Check warning on line 27 in src/plugins/theme.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected any. Specify a different type
const classes = ["input"];
if (isTrueish(props.type == "textarea")) classes.push("textarea");
return classes.join(" ");
Expand All @@ -41,7 +41,7 @@
},
select: {
override: true,
rootClass: (_: string, props: Record<string, any>) => {

Check warning on line 44 in src/plugins/theme.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected any. Specify a different type
const classes = ["select", "control"];
if (isTrueish(props.size)) classes.push(`is-${props.size}`);
if (isTrueish(props.rounded)) classes.push("is-rounded");
Expand Down Expand Up @@ -70,7 +70,7 @@
},
checkbox: {
override: true,
rootClass: "checkbox",
rootClass: "checkbox control",
disabledClass: "is-disabled",
inputClass: "check",
labelClass: "control-label",
Expand All @@ -79,7 +79,7 @@
},
radio: {
override: true,
rootClass: "radio",
rootClass: "radio control",
disabledClass: "is-disabled",
inputClass: "check",
labelClass: "control-label",
Expand All @@ -88,7 +88,7 @@
},
switch: {
override: true,
rootClass: "switch",
rootClass: "switch control",
inputClass: "check",
positionClass: (value) => `has-${value}-label`,
roundedClass: "is-rounded",
Expand Down Expand Up @@ -143,7 +143,7 @@
},
pagination: {
override: true,
rootClass: (_: string, props: Record<string, any>) => {

Check warning on line 146 in src/plugins/theme.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected any. Specify a different type
const classes = ["pagination"];
if (props.rounded) classes.push("is-rounded");
return classes.join(" ");
Expand Down Expand Up @@ -329,7 +329,7 @@
prevButtonClass: "button-prev",
nextButtonClass: "button-next",
listsClass: "select-list",
tableBodyClass: (_: string, props: Record<string, any>) => {

Check warning on line 332 in src/plugins/theme.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected any. Specify a different type
const classes = ["datepicker-body"];
if (props.events) classes.push(`has-events`);
return classes.join(" ");
Expand Down