2024-05-14 09:09:56 -04:00
|
|
|
.form-check-input {
|
|
|
|
@function form-check-box-svg($color) {
|
|
|
|
@return url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='#{$color}' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/></svg>");
|
|
|
|
}
|
2024-07-22 04:10:54 -04:00
|
|
|
|
2024-05-14 09:09:56 -04:00
|
|
|
@function form-check-radio-svg($color) {
|
|
|
|
@return url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='2' fill='#{$color}'/></svg>");
|
|
|
|
}
|
2024-07-22 04:10:54 -04:00
|
|
|
|
2024-05-14 09:09:56 -04:00
|
|
|
@function form-check-indeterminate-svg($color) {
|
|
|
|
@return url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='#{$color}' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/></svg>");
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
&:not(:disabled) {
|
|
|
|
border-color: var(--border-hover);
|
|
|
|
|
|
|
|
&:checked,
|
|
|
|
&[type='checkbox']:indeterminate {
|
|
|
|
background-color: var(--bg-accent-02);
|
|
|
|
border-color: var(--bg-accent-02);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
@mixin input-disabled-styles {
|
|
|
|
background-color: $input-disabled-bg;
|
|
|
|
border-color: $input-disabled-border-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
@include input-disabled-styles;
|
|
|
|
|
|
|
|
&[type='checkbox']:indeterminate {
|
|
|
|
@include input-disabled-styles;
|
|
|
|
|
|
|
|
background-image: escape-svg(form-check-indeterminate-svg($neutral-40));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Use disabled attribute in addition of :disabled pseudo-class
|
|
|
|
// See: https://github.com/twbs/bootstrap/issues/28247
|
|
|
|
&[disabled],
|
|
|
|
&:disabled {
|
|
|
|
~ .form-check-label {
|
|
|
|
color: $input-disabled-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:checked {
|
|
|
|
&[type='checkbox'] {
|
|
|
|
background-image: escape-svg(form-check-box-svg($neutral-40));
|
|
|
|
}
|
|
|
|
|
|
|
|
&[type='radio'] {
|
|
|
|
background-image: escape-svg(form-check-radio-svg($neutral-40));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-18 09:47:24 -04:00
|
|
|
|
|
|
|
&:focus-visible {
|
|
|
|
outline: 0;
|
|
|
|
border-color: $input-focus-border-color;
|
|
|
|
box-shadow: $input-focus-box-shadow;
|
|
|
|
}
|
2024-05-14 09:09:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
.form-control {
|
|
|
|
&[disabled],
|
|
|
|
&:disabled {
|
|
|
|
&::placeholder {
|
|
|
|
color: var(--content-disabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-18 06:14:45 -04:00
|
|
|
.form-switch {
|
|
|
|
.form-check-input {
|
|
|
|
--bs-form-check-bg: var(--bg-dark-tertiary);
|
|
|
|
|
|
|
|
height: 20px;
|
|
|
|
margin: 0;
|
|
|
|
border: 0;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
opacity: 0.32;
|
|
|
|
background-color: var(--bg-dark-tertiary);
|
|
|
|
|
|
|
|
&:checked {
|
|
|
|
background-color: var(--bg-accent-01);
|
|
|
|
background-image: #{escape-svg(
|
|
|
|
url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#{$component-active-color}'/></svg>")
|
|
|
|
)};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-14 09:09:56 -04:00
|
|
|
.form-text {
|
|
|
|
display: inline-flex;
|
|
|
|
gap: $spacing-02;
|
|
|
|
line-height: var(--line-height-02);
|
|
|
|
|
|
|
|
.form-control[disabled] ~ & {
|
|
|
|
color: var(--content-disabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-label {
|
2024-09-30 04:11:26 -04:00
|
|
|
&:has(+ .form-control[disabled], + .form-control-wrapper-disabled) {
|
2024-05-14 09:09:56 -04:00
|
|
|
color: var(--content-disabled);
|
|
|
|
}
|
|
|
|
}
|
2024-06-03 08:07:10 -04:00
|
|
|
|
|
|
|
.form-group {
|
2024-08-13 07:37:15 -04:00
|
|
|
margin-bottom: $form-group-margin-bottom;
|
2024-06-03 08:07:10 -04:00
|
|
|
}
|
2024-07-16 06:40:21 -04:00
|
|
|
|
|
|
|
.form-control-wrapper {
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&.form-control-wrapper-disabled {
|
|
|
|
.form-control-start-icon,
|
|
|
|
.form-control-end-icon {
|
|
|
|
& > * {
|
|
|
|
color: var(--content-disabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control-start-icon,
|
|
|
|
.form-control-end-icon {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control-start-icon {
|
|
|
|
left: 0;
|
2024-07-22 04:10:54 -04:00
|
|
|
padding-left: calc(var(--form-control-padding-x) + var(--bs-border-width));
|
2024-07-16 06:40:21 -04:00
|
|
|
}
|
2024-07-22 04:10:54 -04:00
|
|
|
|
2024-07-16 06:40:21 -04:00
|
|
|
.form-control-end-icon {
|
|
|
|
right: 0;
|
2024-07-22 04:10:54 -04:00
|
|
|
padding-right: calc(var(--form-control-padding-x) + var(--bs-border-width));
|
2024-07-16 06:40:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
--icon-width: 20px;
|
|
|
|
--form-control-padding-x: var(--spacing-04);
|
|
|
|
--form-control-icon-offset-y: var(--spacing-04);
|
|
|
|
|
|
|
|
&.form-control-wrapper-sm {
|
|
|
|
--form-control-padding-x: var(--spacing-03);
|
|
|
|
--form-control-icon-offset-y: var(--spacing-02);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.form-control-wrapper-lg {
|
|
|
|
--form-control-padding-x: var(--spacing-05);
|
|
|
|
--form-control-icon-offset-y: var(--spacing-05);
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control-offset-start {
|
|
|
|
padding-left: calc(
|
|
|
|
var(--form-control-padding-x) + var(--form-control-icon-offset-y) +
|
|
|
|
var(--icon-width)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control-offset-end {
|
|
|
|
padding-right: calc(
|
|
|
|
var(--form-control-padding-x) + var(--form-control-icon-offset-y) +
|
|
|
|
var(--icon-width)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2024-07-18 09:47:24 -04:00
|
|
|
|
|
|
|
.form-control,
|
|
|
|
.form-select {
|
2024-08-07 09:38:42 -04:00
|
|
|
&:focus,
|
|
|
|
&:invalid:focus,
|
|
|
|
&.is-invalid:focus,
|
|
|
|
&:focus-visible,
|
|
|
|
&:invalid:focus-visible,
|
|
|
|
&.is-invalid:focus-visible {
|
2024-07-18 09:47:24 -04:00
|
|
|
color: $input-focus-color;
|
|
|
|
background-color: $input-focus-bg;
|
|
|
|
outline: 0;
|
|
|
|
border-color: $input-focus-border-color;
|
|
|
|
box-shadow: $input-focus-box-shadow;
|
|
|
|
}
|
|
|
|
}
|
2024-09-27 10:24:24 -04:00
|
|
|
|
|
|
|
.website-redesign {
|
|
|
|
label {
|
|
|
|
color: $form-text-color;
|
|
|
|
display: inline-block;
|
|
|
|
margin-bottom: var(--spacing-02);
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
|
|
@include body-sm;
|
|
|
|
}
|
2024-10-07 04:47:43 -04:00
|
|
|
|
|
|
|
.checkbox-label {
|
|
|
|
margin-left: var(--spacing-04);
|
|
|
|
}
|
2024-09-27 10:24:24 -04:00
|
|
|
}
|
2024-10-09 08:13:50 -04:00
|
|
|
|
|
|
|
%input-focus-style {
|
|
|
|
border-color: $input-focus-border-color;
|
|
|
|
box-shadow: $form-check-input-focus-box-shadow;
|
|
|
|
}
|