mirror of
https://github.com/picocss/pico.git
synced 2025-04-24 02:16:15 -04:00
Build CSS
This commit is contained in:
parent
ddf41a191a
commit
951aae3801
77 changed files with 7702 additions and 7702 deletions
|
@ -1,494 +1,494 @@
|
|||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/basics") {
|
||||
// Helper
|
||||
$helper-previous-tags: "input, select, textarea, fieldset";
|
||||
/**
|
||||
* Basics form elements
|
||||
*/
|
||||
|
||||
// Reboot based on :
|
||||
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
|
||||
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
|
||||
// ––––––––––––––––––––
|
||||
|
||||
// 1. Change the font styles in all browsers
|
||||
// 2. Remove the margin in Firefox and Safari
|
||||
#{$parent-selector} input,
|
||||
#{$parent-selector} optgroup,
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
margin: 0; // 2
|
||||
font-size: 1rem; // 1
|
||||
line-height: var(#{$css-var-prefix}line-height); // 1
|
||||
font-family: inherit; // 1
|
||||
letter-spacing: inherit; // 2
|
||||
}
|
||||
|
||||
// Show the overflow in IE.
|
||||
#{$parent-selector} input {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
// Remove the inheritance of text transform in Edge, Firefox, and IE
|
||||
#{$parent-selector} select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
// 1. Correct the text wrapping in Edge and IE
|
||||
// 2. Correct the color inheritance from `fieldset` elements in IE
|
||||
// 3. Remove the padding so developers are not caught out when they zero out
|
||||
// `fieldset` elements in all browsers
|
||||
#{$parent-selector} legend {
|
||||
max-width: 100%; // 1
|
||||
padding: 0; // 3
|
||||
color: inherit; // 2
|
||||
white-space: normal; // 1
|
||||
}
|
||||
|
||||
// 1. Remove the default vertical scrollbar in IE
|
||||
#{$parent-selector} textarea {
|
||||
overflow: auto; // 1
|
||||
}
|
||||
|
||||
// Remove the padding in IE 10
|
||||
#{$parent-selector} [type="checkbox"],
|
||||
#{$parent-selector} [type="radio"] {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
// Correct the cursor style of increment and decrement buttons in Safari
|
||||
#{$parent-selector} ::-webkit-inner-spin-button,
|
||||
#{$parent-selector} ::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
// 1. Correct the odd appearance in Chrome and Safari
|
||||
// 2. Correct the outline style in Safari
|
||||
#{$parent-selector} [type="search"] {
|
||||
-webkit-appearance: textfield; // 1
|
||||
outline-offset: -2px; // 2
|
||||
}
|
||||
|
||||
// Remove the inner padding in Chrome and Safari on macOS
|
||||
#{$parent-selector} [type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
// 1. Correct the inability to style clickable types in iOS and Safari
|
||||
// 2. Change font properties to `inherit` in Safari
|
||||
#{$parent-selector} ::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; // 1
|
||||
font: inherit; // 2
|
||||
}
|
||||
|
||||
// Remove the inner border and padding of focus outlines in Firefox
|
||||
#{$parent-selector} ::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
// Remove the focus outline in Firefox
|
||||
#{$parent-selector} :-moz-focusring {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
// Remove the additional :invalid styles in Firefox
|
||||
#{$parent-selector} :-moz-ui-invalid {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
// Change the inconsistent appearance in IE (opinionated)
|
||||
#{$parent-selector} ::-ms-expand {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Remove the border and padding in all browsers (opinionated)
|
||||
#{$parent-selector} [type="file"],
|
||||
#{$parent-selector} [type="range"] {
|
||||
padding: 0;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
// Pico
|
||||
// ––––––––––––––––––––
|
||||
|
||||
// Force height for alternatives input types
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"], [type="range"], [type="date"]) {
|
||||
//,
|
||||
//#{$parent-selector} [role="group"] > label,
|
||||
//#{$parent-selector} [role="group"] > legend {
|
||||
height: calc(
|
||||
(1rem * var(#{$css-var-prefix}line-height)) +
|
||||
(var(#{$css-var-prefix}form-element-spacing-vertical) * 2) +
|
||||
(var(#{$css-var-prefix}border-width) * 2)
|
||||
);
|
||||
}
|
||||
|
||||
// Fieldset
|
||||
#{$parent-selector} fieldset {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
margin-bottom: var(#{$css-var-prefix}spacing);
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
// Label & legend
|
||||
#{$parent-selector} label,
|
||||
#{$parent-selector} fieldset legend {
|
||||
display: block;
|
||||
margin-bottom: calc(var(#{$css-var-prefix}spacing) * 0.375);
|
||||
color: var(#{$css-var-prefix}color);
|
||||
font-weight: var(#{$css-var-prefix}form-label-font-weight, var(#{$css-var-prefix}font-weight));
|
||||
}
|
||||
|
||||
#{$parent-selector} fieldset legend {
|
||||
margin-bottom: calc(var(#{$css-var-prefix}spacing) * 0.5);
|
||||
}
|
||||
|
||||
// Blocks, 100%
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"]),
|
||||
#{$parent-selector} button[type="submit"],
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// Reset appearance (Not Checkboxes, Radios, Range and File)
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]),
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
appearance: none;
|
||||
padding: var(#{$css-var-prefix}form-element-spacing-vertical)
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
}
|
||||
|
||||
// Commons styles
|
||||
#{$parent-selector} input,
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}form-element-background-color);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-border-color);
|
||||
#{$css-var-prefix}color: var(#{$css-var-prefix}form-element-color);
|
||||
#{$css-var-prefix}box-shadow: none;
|
||||
border: var(#{$css-var-prefix}border-width) solid var(#{$css-var-prefix}border-color);
|
||||
border-radius: var(#{$css-var-prefix}border-radius);
|
||||
outline: none;
|
||||
background-color: var(#{$css-var-prefix}background-color);
|
||||
box-shadow: var(#{$css-var-prefix}box-shadow);
|
||||
color: var(#{$css-var-prefix}color);
|
||||
font-weight: var(#{$css-var-prefix}font-weight);
|
||||
|
||||
@if $enable-transitions {
|
||||
transition:
|
||||
background-color var(#{$css-var-prefix}transition),
|
||||
border-color var(#{$css-var-prefix}transition),
|
||||
color var(#{$css-var-prefix}transition),
|
||||
box-shadow var(#{$css-var-prefix}transition);
|
||||
}
|
||||
}
|
||||
|
||||
// Active & Focus
|
||||
#{$parent-selector}
|
||||
input:not(
|
||||
[type="submit"],
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="checkbox"],
|
||||
[type="radio"],
|
||||
[readonly]
|
||||
),
|
||||
#{$parent-selector} :where(select, textarea):not([readonly]) {
|
||||
&:is(:active, :focus) {
|
||||
#{$css-var-prefix}background-color: var(
|
||||
#{$css-var-prefix}form-element-active-background-color
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Active & Focus
|
||||
#{$parent-selector}
|
||||
input:not([type="submit"], [type="button"], [type="reset"], [role="switch"], [readonly]),
|
||||
#{$parent-selector} :where(select, textarea):not([readonly]) {
|
||||
&:is(:active, :focus) {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-active-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
// Focus
|
||||
#{$parent-selector}
|
||||
input:not(
|
||||
[type="submit"],
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="range"],
|
||||
[type="file"],
|
||||
[readonly]
|
||||
),
|
||||
#{$parent-selector} :where(select, textarea):not([readonly]) {
|
||||
&:focus {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-focus-color);
|
||||
}
|
||||
}
|
||||
|
||||
// Disabled
|
||||
#{$parent-selector} input:not([type="submit"], [type="button"], [type="reset"])[disabled],
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend,
|
||||
#{$parent-selector} select[disabled],
|
||||
#{$parent-selector} textarea[disabled],
|
||||
#{$parent-selector} label[aria-disabled="true"],
|
||||
#{$parent-selector}
|
||||
:where(fieldset[disabled])
|
||||
:is(input:not([type="submit"], [type="button"], [type="reset"]), select, textarea) {
|
||||
opacity: var(#{$css-var-prefix}form-element-disabled-opacity);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#{$parent-selector} label[aria-disabled="true"] input[disabled],
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
// Aria-invalid
|
||||
#{$parent-selector} :not([novalidate]) :where(input, select, textarea) {
|
||||
&:not(
|
||||
[type="checkbox"],
|
||||
[type="radio"],
|
||||
[type="date"],
|
||||
[type="datetime-local"],
|
||||
[type="month"],
|
||||
[type="time"],
|
||||
[type="week"],
|
||||
[type="range"]
|
||||
) {
|
||||
&[aria-invalid] {
|
||||
@if $enable-important {
|
||||
padding-right: calc(
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem
|
||||
) !important;
|
||||
padding-left: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-start: var(#{$css-var-prefix}form-element-spacing-horizontal) !important;
|
||||
padding-inline-end: calc(
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem
|
||||
) !important;
|
||||
} @else {
|
||||
padding-right: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem);
|
||||
padding-left: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-start: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-end: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem);
|
||||
}
|
||||
background-position: center right 0.75rem;
|
||||
background-size: 1rem auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
&[aria-invalid="false"]:not(select) {
|
||||
background-image: var(#{$css-var-prefix}icon-valid);
|
||||
}
|
||||
|
||||
&[aria-invalid="true"]:not(select) {
|
||||
background-image: var(#{$css-var-prefix}icon-invalid);
|
||||
}
|
||||
}
|
||||
|
||||
&[aria-invalid="false"] {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
|
||||
&:is(:active, :focus) {
|
||||
@if $enable-important {
|
||||
#{$css-var-prefix}border-color: var(
|
||||
#{$css-var-prefix}form-element-valid-active-border-color
|
||||
) !important;
|
||||
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-valid-focus-color) !important;
|
||||
}
|
||||
} @else {
|
||||
#{$css-var-prefix}border-color: var(
|
||||
#{$css-var-prefix}form-element-valid-active-border-color
|
||||
);
|
||||
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-valid-focus-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&[aria-invalid="true"] {
|
||||
// --pico-form-element-invalid-border-color
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
|
||||
&:is(:active, :focus) {
|
||||
@if $enable-important {
|
||||
#{$css-var-prefix}border-color: var(
|
||||
#{$css-var-prefix}form-element-invalid-active-border-color
|
||||
) !important;
|
||||
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-invalid-focus-color) !important;
|
||||
}
|
||||
} @else {
|
||||
#{$css-var-prefix}border-color: var(
|
||||
#{$css-var-prefix}form-element-invalid-active-border-color
|
||||
);
|
||||
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-invalid-focus-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] {
|
||||
#{$parent-selector} :where(input, select, textarea) {
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
&:is([aria-invalid], [aria-invalid="true"], [aria-invalid="false"]) {
|
||||
background-position: center left 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Placeholder
|
||||
#{$parent-selector} input::placeholder,
|
||||
#{$parent-selector} input::-webkit-input-placeholder,
|
||||
#{$parent-selector} textarea::placeholder,
|
||||
#{$parent-selector} textarea::-webkit-input-placeholder,
|
||||
#{$parent-selector} select:invalid,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
color: var(#{$css-var-prefix}form-element-placeholder-color);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
// Margin bottom (Not Checkboxes and Radios)
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"]),
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
margin-bottom: var(#{$css-var-prefix}spacing);
|
||||
}
|
||||
|
||||
// Select
|
||||
#{$parent-selector} select {
|
||||
// Unstyle the caret on `<select>`s in IE10+.
|
||||
&::-ms-expand {
|
||||
border: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&:not([multiple], [size]) {
|
||||
padding-right: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem);
|
||||
padding-left: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-start: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-end: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem);
|
||||
background-image: var(#{$css-var-prefix}icon-chevron);
|
||||
background-position: center right 0.75rem;
|
||||
background-size: 1rem auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
&[multiple] {
|
||||
option {
|
||||
&:checked {
|
||||
background: var(#{$css-var-prefix}form-element-selected-background-color);
|
||||
color: var(#{$css-var-prefix}form-element-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] {
|
||||
#{$parent-selector} select {
|
||||
&:not([multiple], [size]) {
|
||||
background-position: center left 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Textarea
|
||||
#{$parent-selector} textarea {
|
||||
display: block;
|
||||
resize: vertical;
|
||||
|
||||
&[aria-invalid] {
|
||||
@if $enable-important {
|
||||
#{$css-var-prefix}icon-height: calc(
|
||||
(1rem * var(#{$css-var-prefix}line-height)) +
|
||||
(var(#{$css-var-prefix}form-element-spacing-vertical) * 2) +
|
||||
(var(#{$css-var-prefix}border-width) * 2)
|
||||
);
|
||||
background-position: top right 0.75rem !important;
|
||||
background-size: 1rem var(#{$css-var-prefix}icon-height) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if map.get($modules, "layout/grid") and $enable-classes {
|
||||
$helper-previous-tags: $helper-previous-tags + ", .grid";
|
||||
}
|
||||
|
||||
@if map.get($modules, "components/dropdown") and $enable-classes {
|
||||
$helper-previous-tags: $helper-previous-tags + ", .dropdown";
|
||||
}
|
||||
|
||||
#{$parent-selector} :where(#{$helper-previous-tags}) {
|
||||
+ small {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: calc(var(#{$css-var-prefix}spacing) * -0.75);
|
||||
margin-bottom: var(#{$css-var-prefix}spacing);
|
||||
color: var(#{$css-var-prefix}muted-color);
|
||||
}
|
||||
&[aria-invalid="false"] {
|
||||
+ small {
|
||||
color: var(#{$css-var-prefix}ins-color);
|
||||
}
|
||||
}
|
||||
&[aria-invalid="true"] {
|
||||
+ small {
|
||||
color: var(#{$css-var-prefix}del-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Styles for Input inside a label
|
||||
#{$parent-selector} label {
|
||||
> :where(input, select, textarea) {
|
||||
margin-top: calc(var(#{$css-var-prefix}spacing) * 0.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/basics") {
|
||||
// Helper
|
||||
$helper-previous-tags: "input, select, textarea, fieldset";
|
||||
/**
|
||||
* Basics form elements
|
||||
*/
|
||||
|
||||
// Reboot based on :
|
||||
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
|
||||
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
|
||||
// ––––––––––––––––––––
|
||||
|
||||
// 1. Change the font styles in all browsers
|
||||
// 2. Remove the margin in Firefox and Safari
|
||||
#{$parent-selector} input,
|
||||
#{$parent-selector} optgroup,
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
margin: 0; // 2
|
||||
font-size: 1rem; // 1
|
||||
line-height: var(#{$css-var-prefix}line-height); // 1
|
||||
font-family: inherit; // 1
|
||||
letter-spacing: inherit; // 2
|
||||
}
|
||||
|
||||
// Show the overflow in IE.
|
||||
#{$parent-selector} input {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
// Remove the inheritance of text transform in Edge, Firefox, and IE
|
||||
#{$parent-selector} select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
// 1. Correct the text wrapping in Edge and IE
|
||||
// 2. Correct the color inheritance from `fieldset` elements in IE
|
||||
// 3. Remove the padding so developers are not caught out when they zero out
|
||||
// `fieldset` elements in all browsers
|
||||
#{$parent-selector} legend {
|
||||
max-width: 100%; // 1
|
||||
padding: 0; // 3
|
||||
color: inherit; // 2
|
||||
white-space: normal; // 1
|
||||
}
|
||||
|
||||
// 1. Remove the default vertical scrollbar in IE
|
||||
#{$parent-selector} textarea {
|
||||
overflow: auto; // 1
|
||||
}
|
||||
|
||||
// Remove the padding in IE 10
|
||||
#{$parent-selector} [type="checkbox"],
|
||||
#{$parent-selector} [type="radio"] {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
// Correct the cursor style of increment and decrement buttons in Safari
|
||||
#{$parent-selector} ::-webkit-inner-spin-button,
|
||||
#{$parent-selector} ::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
// 1. Correct the odd appearance in Chrome and Safari
|
||||
// 2. Correct the outline style in Safari
|
||||
#{$parent-selector} [type="search"] {
|
||||
-webkit-appearance: textfield; // 1
|
||||
outline-offset: -2px; // 2
|
||||
}
|
||||
|
||||
// Remove the inner padding in Chrome and Safari on macOS
|
||||
#{$parent-selector} [type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
// 1. Correct the inability to style clickable types in iOS and Safari
|
||||
// 2. Change font properties to `inherit` in Safari
|
||||
#{$parent-selector} ::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; // 1
|
||||
font: inherit; // 2
|
||||
}
|
||||
|
||||
// Remove the inner border and padding of focus outlines in Firefox
|
||||
#{$parent-selector} ::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
// Remove the focus outline in Firefox
|
||||
#{$parent-selector} :-moz-focusring {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
// Remove the additional :invalid styles in Firefox
|
||||
#{$parent-selector} :-moz-ui-invalid {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
// Change the inconsistent appearance in IE (opinionated)
|
||||
#{$parent-selector} ::-ms-expand {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Remove the border and padding in all browsers (opinionated)
|
||||
#{$parent-selector} [type="file"],
|
||||
#{$parent-selector} [type="range"] {
|
||||
padding: 0;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
// Pico
|
||||
// ––––––––––––––––––––
|
||||
|
||||
// Force height for alternatives input types
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"], [type="range"], [type="date"]) {
|
||||
//,
|
||||
//#{$parent-selector} [role="group"] > label,
|
||||
//#{$parent-selector} [role="group"] > legend {
|
||||
height: calc(
|
||||
(1rem * var(#{$css-var-prefix}line-height)) +
|
||||
(var(#{$css-var-prefix}form-element-spacing-vertical) * 2) +
|
||||
(var(#{$css-var-prefix}border-width) * 2)
|
||||
);
|
||||
}
|
||||
|
||||
// Fieldset
|
||||
#{$parent-selector} fieldset {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
margin-bottom: var(#{$css-var-prefix}spacing);
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
// Label & legend
|
||||
#{$parent-selector} label,
|
||||
#{$parent-selector} fieldset legend {
|
||||
display: block;
|
||||
margin-bottom: calc(var(#{$css-var-prefix}spacing) * 0.375);
|
||||
color: var(#{$css-var-prefix}color);
|
||||
font-weight: var(#{$css-var-prefix}form-label-font-weight, var(#{$css-var-prefix}font-weight));
|
||||
}
|
||||
|
||||
#{$parent-selector} fieldset legend {
|
||||
margin-bottom: calc(var(#{$css-var-prefix}spacing) * 0.5);
|
||||
}
|
||||
|
||||
// Blocks, 100%
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"]),
|
||||
#{$parent-selector} button[type="submit"],
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// Reset appearance (Not Checkboxes, Radios, Range and File)
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]),
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
appearance: none;
|
||||
padding: var(#{$css-var-prefix}form-element-spacing-vertical)
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
}
|
||||
|
||||
// Commons styles
|
||||
#{$parent-selector} input,
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}form-element-background-color);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-border-color);
|
||||
#{$css-var-prefix}color: var(#{$css-var-prefix}form-element-color);
|
||||
#{$css-var-prefix}box-shadow: none;
|
||||
border: var(#{$css-var-prefix}border-width) solid var(#{$css-var-prefix}border-color);
|
||||
border-radius: var(#{$css-var-prefix}border-radius);
|
||||
outline: none;
|
||||
background-color: var(#{$css-var-prefix}background-color);
|
||||
box-shadow: var(#{$css-var-prefix}box-shadow);
|
||||
color: var(#{$css-var-prefix}color);
|
||||
font-weight: var(#{$css-var-prefix}font-weight);
|
||||
|
||||
@if $enable-transitions {
|
||||
transition:
|
||||
background-color var(#{$css-var-prefix}transition),
|
||||
border-color var(#{$css-var-prefix}transition),
|
||||
color var(#{$css-var-prefix}transition),
|
||||
box-shadow var(#{$css-var-prefix}transition);
|
||||
}
|
||||
}
|
||||
|
||||
// Active & Focus
|
||||
#{$parent-selector}
|
||||
input:not(
|
||||
[type="submit"],
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="checkbox"],
|
||||
[type="radio"],
|
||||
[readonly]
|
||||
),
|
||||
#{$parent-selector} :where(select, textarea):not([readonly]) {
|
||||
&:is(:active, :focus) {
|
||||
#{$css-var-prefix}background-color: var(
|
||||
#{$css-var-prefix}form-element-active-background-color
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Active & Focus
|
||||
#{$parent-selector}
|
||||
input:not([type="submit"], [type="button"], [type="reset"], [role="switch"], [readonly]),
|
||||
#{$parent-selector} :where(select, textarea):not([readonly]) {
|
||||
&:is(:active, :focus) {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-active-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
// Focus
|
||||
#{$parent-selector}
|
||||
input:not(
|
||||
[type="submit"],
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="range"],
|
||||
[type="file"],
|
||||
[readonly]
|
||||
),
|
||||
#{$parent-selector} :where(select, textarea):not([readonly]) {
|
||||
&:focus {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-focus-color);
|
||||
}
|
||||
}
|
||||
|
||||
// Disabled
|
||||
#{$parent-selector} input:not([type="submit"], [type="button"], [type="reset"])[disabled],
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend,
|
||||
#{$parent-selector} select[disabled],
|
||||
#{$parent-selector} textarea[disabled],
|
||||
#{$parent-selector} label[aria-disabled="true"],
|
||||
#{$parent-selector}
|
||||
:where(fieldset[disabled])
|
||||
:is(input:not([type="submit"], [type="button"], [type="reset"]), select, textarea) {
|
||||
opacity: var(#{$css-var-prefix}form-element-disabled-opacity);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#{$parent-selector} label[aria-disabled="true"] input[disabled],
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
// Aria-invalid
|
||||
#{$parent-selector} :not([novalidate]) :where(input, select, textarea) {
|
||||
&:not(
|
||||
[type="checkbox"],
|
||||
[type="radio"],
|
||||
[type="date"],
|
||||
[type="datetime-local"],
|
||||
[type="month"],
|
||||
[type="time"],
|
||||
[type="week"],
|
||||
[type="range"]
|
||||
) {
|
||||
&[aria-invalid] {
|
||||
@if $enable-important {
|
||||
padding-right: calc(
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem
|
||||
) !important;
|
||||
padding-left: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-start: var(#{$css-var-prefix}form-element-spacing-horizontal) !important;
|
||||
padding-inline-end: calc(
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem
|
||||
) !important;
|
||||
} @else {
|
||||
padding-right: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem);
|
||||
padding-left: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-start: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-end: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem);
|
||||
}
|
||||
background-position: center right 0.75rem;
|
||||
background-size: 1rem auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
&[aria-invalid="false"]:not(select) {
|
||||
background-image: var(#{$css-var-prefix}icon-valid);
|
||||
}
|
||||
|
||||
&[aria-invalid="true"]:not(select) {
|
||||
background-image: var(#{$css-var-prefix}icon-invalid);
|
||||
}
|
||||
}
|
||||
|
||||
&[aria-invalid="false"] {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
|
||||
&:is(:active, :focus) {
|
||||
@if $enable-important {
|
||||
#{$css-var-prefix}border-color: var(
|
||||
#{$css-var-prefix}form-element-valid-active-border-color
|
||||
) !important;
|
||||
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-valid-focus-color) !important;
|
||||
}
|
||||
} @else {
|
||||
#{$css-var-prefix}border-color: var(
|
||||
#{$css-var-prefix}form-element-valid-active-border-color
|
||||
);
|
||||
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-valid-focus-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&[aria-invalid="true"] {
|
||||
// --pico-form-element-invalid-border-color
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
|
||||
&:is(:active, :focus) {
|
||||
@if $enable-important {
|
||||
#{$css-var-prefix}border-color: var(
|
||||
#{$css-var-prefix}form-element-invalid-active-border-color
|
||||
) !important;
|
||||
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-invalid-focus-color) !important;
|
||||
}
|
||||
} @else {
|
||||
#{$css-var-prefix}border-color: var(
|
||||
#{$css-var-prefix}form-element-invalid-active-border-color
|
||||
);
|
||||
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
#{$css-var-prefix}box-shadow: 0
|
||||
0
|
||||
0
|
||||
var(#{$css-var-prefix}outline-width)
|
||||
var(#{$css-var-prefix}form-element-invalid-focus-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] {
|
||||
#{$parent-selector} :where(input, select, textarea) {
|
||||
&:not([type="checkbox"], [type="radio"]) {
|
||||
&:is([aria-invalid], [aria-invalid="true"], [aria-invalid="false"]) {
|
||||
background-position: center left 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Placeholder
|
||||
#{$parent-selector} input::placeholder,
|
||||
#{$parent-selector} input::-webkit-input-placeholder,
|
||||
#{$parent-selector} textarea::placeholder,
|
||||
#{$parent-selector} textarea::-webkit-input-placeholder,
|
||||
#{$parent-selector} select:invalid,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
color: var(#{$css-var-prefix}form-element-placeholder-color);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
// Margin bottom (Not Checkboxes and Radios)
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"]),
|
||||
#{$parent-selector} select,
|
||||
#{$parent-selector} textarea,
|
||||
#{$parent-selector} [role="group"] > label,
|
||||
#{$parent-selector} [role="group"] > legend {
|
||||
margin-bottom: var(#{$css-var-prefix}spacing);
|
||||
}
|
||||
|
||||
// Select
|
||||
#{$parent-selector} select {
|
||||
// Unstyle the caret on `<select>`s in IE10+.
|
||||
&::-ms-expand {
|
||||
border: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&:not([multiple], [size]) {
|
||||
padding-right: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem);
|
||||
padding-left: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-start: var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
padding-inline-end: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.5rem);
|
||||
background-image: var(#{$css-var-prefix}icon-chevron);
|
||||
background-position: center right 0.75rem;
|
||||
background-size: 1rem auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
&[multiple] {
|
||||
option {
|
||||
&:checked {
|
||||
background: var(#{$css-var-prefix}form-element-selected-background-color);
|
||||
color: var(#{$css-var-prefix}form-element-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] {
|
||||
#{$parent-selector} select {
|
||||
&:not([multiple], [size]) {
|
||||
background-position: center left 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Textarea
|
||||
#{$parent-selector} textarea {
|
||||
display: block;
|
||||
resize: vertical;
|
||||
|
||||
&[aria-invalid] {
|
||||
@if $enable-important {
|
||||
#{$css-var-prefix}icon-height: calc(
|
||||
(1rem * var(#{$css-var-prefix}line-height)) +
|
||||
(var(#{$css-var-prefix}form-element-spacing-vertical) * 2) +
|
||||
(var(#{$css-var-prefix}border-width) * 2)
|
||||
);
|
||||
background-position: top right 0.75rem !important;
|
||||
background-size: 1rem var(#{$css-var-prefix}icon-height) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if map.get($modules, "layout/grid") and $enable-classes {
|
||||
$helper-previous-tags: $helper-previous-tags + ", .grid";
|
||||
}
|
||||
|
||||
@if map.get($modules, "components/dropdown") and $enable-classes {
|
||||
$helper-previous-tags: $helper-previous-tags + ", .dropdown";
|
||||
}
|
||||
|
||||
#{$parent-selector} :where(#{$helper-previous-tags}) {
|
||||
+ small {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: calc(var(#{$css-var-prefix}spacing) * -0.75);
|
||||
margin-bottom: var(#{$css-var-prefix}spacing);
|
||||
color: var(#{$css-var-prefix}muted-color);
|
||||
}
|
||||
&[aria-invalid="false"] {
|
||||
+ small {
|
||||
color: var(#{$css-var-prefix}ins-color);
|
||||
}
|
||||
}
|
||||
&[aria-invalid="true"] {
|
||||
+ small {
|
||||
color: var(#{$css-var-prefix}del-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Styles for Input inside a label
|
||||
#{$parent-selector} label {
|
||||
> :where(input, select, textarea) {
|
||||
margin-top: calc(var(#{$css-var-prefix}spacing) * 0.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,177 +1,177 @@
|
|||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/checkbox-radio-switch") {
|
||||
/**
|
||||
* Checkboxes, Radios and Switches
|
||||
*/
|
||||
|
||||
// Labels
|
||||
// Not working in Firefox, which doesn't support the `:has()` pseudo-class
|
||||
#{$parent-selector} label {
|
||||
&:has([type="checkbox"], [type="radio"]) {
|
||||
width: fit-content;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
#{$parent-selector} [type="checkbox"],
|
||||
#{$parent-selector} [type="radio"] {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
width: 1.25em;
|
||||
height: 1.25em;
|
||||
margin-top: -0.125em;
|
||||
margin-inline-end: 0.5em;
|
||||
border-width: var(#{$css-var-prefix}border-width);
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
|
||||
&::-ms-check {
|
||||
display: none; // unstyle IE checkboxes
|
||||
}
|
||||
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}primary-background);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}primary-border);
|
||||
background-image: var(#{$css-var-prefix}icon-checkbox);
|
||||
background-position: center;
|
||||
background-size: 0.75em auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
& ~ label {
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
cursor: pointer;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
margin-inline-end: 1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Checkboxes
|
||||
#{$parent-selector} [type="checkbox"] {
|
||||
&:indeterminate {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}primary-background);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}primary-border);
|
||||
background-image: var(#{$css-var-prefix}icon-minus);
|
||||
background-position: center;
|
||||
background-size: 0.75em auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
// Radios
|
||||
#{$parent-selector} [type="radio"] {
|
||||
border-radius: 50%;
|
||||
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}primary-inverse);
|
||||
border-width: 0.35em;
|
||||
background-image: none;
|
||||
}
|
||||
}
|
||||
|
||||
// Switches
|
||||
#{$parent-selector} [type="checkbox"][role="switch"] {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}switch-background-color);
|
||||
#{$css-var-prefix}color: var(#{$css-var-prefix}switch-color);
|
||||
|
||||
// Config
|
||||
$switch-height: 1.25em;
|
||||
$switch-width: 2.25em;
|
||||
$switch-transition: 0.1s ease-in-out;
|
||||
|
||||
// Styles
|
||||
width: $switch-width;
|
||||
height: $switch-height;
|
||||
border: var(#{$css-var-prefix}border-width) solid var(#{$css-var-prefix}border-color);
|
||||
border-radius: $switch-height;
|
||||
background-color: var(#{$css-var-prefix}background-color);
|
||||
line-height: $switch-height;
|
||||
|
||||
&:not([aria-invalid]) {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}switch-background-color);
|
||||
}
|
||||
|
||||
&:before {
|
||||
display: block;
|
||||
aspect-ratio: 1;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background-color: var(#{$css-var-prefix}color);
|
||||
box-shadow: var(#{$css-var-prefix}switch-thumb-box-shadow);
|
||||
content: "";
|
||||
|
||||
@if $enable-transitions {
|
||||
transition: margin $switch-transition;
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}switch-background-color);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}switch-background-color);
|
||||
}
|
||||
|
||||
&:checked {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}switch-checked-background-color);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}switch-checked-background-color);
|
||||
background-image: none;
|
||||
|
||||
&::before {
|
||||
margin-inline-start: calc(#{$switch-width} - #{$switch-height});
|
||||
}
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}border-color);
|
||||
}
|
||||
}
|
||||
|
||||
// Aria-invalid
|
||||
#{$parent-selector} :not([novalidate]) [type="checkbox"],
|
||||
#{$parent-selector} :not([novalidate]) [type="checkbox"][role="switch"] {
|
||||
&[aria-invalid="false"] {
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
}
|
||||
}
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
&[aria-invalid="true"] {
|
||||
#{$css-var-prefix}background-color: var(
|
||||
#{$css-var-prefix}form-element-invalid-border-color
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#{$parent-selector} :not([novalidate]) [type="checkbox"],
|
||||
#{$parent-selector} :not([novalidate]) [type="radio"],
|
||||
#{$parent-selector} :not([novalidate]) [type="checkbox"][role="switch"] {
|
||||
&[aria-invalid="false"] {
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
}
|
||||
}
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
&[aria-invalid="true"] {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/checkbox-radio-switch") {
|
||||
/**
|
||||
* Checkboxes, Radios and Switches
|
||||
*/
|
||||
|
||||
// Labels
|
||||
// Not working in Firefox, which doesn't support the `:has()` pseudo-class
|
||||
#{$parent-selector} label {
|
||||
&:has([type="checkbox"], [type="radio"]) {
|
||||
width: fit-content;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
#{$parent-selector} [type="checkbox"],
|
||||
#{$parent-selector} [type="radio"] {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
width: 1.25em;
|
||||
height: 1.25em;
|
||||
margin-top: -0.125em;
|
||||
margin-inline-end: 0.5em;
|
||||
border-width: var(#{$css-var-prefix}border-width);
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
|
||||
&::-ms-check {
|
||||
display: none; // unstyle IE checkboxes
|
||||
}
|
||||
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}primary-background);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}primary-border);
|
||||
background-image: var(#{$css-var-prefix}icon-checkbox);
|
||||
background-position: center;
|
||||
background-size: 0.75em auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
& ~ label {
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
cursor: pointer;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
margin-inline-end: 1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Checkboxes
|
||||
#{$parent-selector} [type="checkbox"] {
|
||||
&:indeterminate {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}primary-background);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}primary-border);
|
||||
background-image: var(#{$css-var-prefix}icon-minus);
|
||||
background-position: center;
|
||||
background-size: 0.75em auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
// Radios
|
||||
#{$parent-selector} [type="radio"] {
|
||||
border-radius: 50%;
|
||||
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}primary-inverse);
|
||||
border-width: 0.35em;
|
||||
background-image: none;
|
||||
}
|
||||
}
|
||||
|
||||
// Switches
|
||||
#{$parent-selector} [type="checkbox"][role="switch"] {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}switch-background-color);
|
||||
#{$css-var-prefix}color: var(#{$css-var-prefix}switch-color);
|
||||
|
||||
// Config
|
||||
$switch-height: 1.25em;
|
||||
$switch-width: 2.25em;
|
||||
$switch-transition: 0.1s ease-in-out;
|
||||
|
||||
// Styles
|
||||
width: $switch-width;
|
||||
height: $switch-height;
|
||||
border: var(#{$css-var-prefix}border-width) solid var(#{$css-var-prefix}border-color);
|
||||
border-radius: $switch-height;
|
||||
background-color: var(#{$css-var-prefix}background-color);
|
||||
line-height: $switch-height;
|
||||
|
||||
&:not([aria-invalid]) {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}switch-background-color);
|
||||
}
|
||||
|
||||
&:before {
|
||||
display: block;
|
||||
aspect-ratio: 1;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background-color: var(#{$css-var-prefix}color);
|
||||
box-shadow: var(#{$css-var-prefix}switch-thumb-box-shadow);
|
||||
content: "";
|
||||
|
||||
@if $enable-transitions {
|
||||
transition: margin $switch-transition;
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}switch-background-color);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}switch-background-color);
|
||||
}
|
||||
|
||||
&:checked {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}switch-checked-background-color);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}switch-checked-background-color);
|
||||
background-image: none;
|
||||
|
||||
&::before {
|
||||
margin-inline-start: calc(#{$switch-width} - #{$switch-height});
|
||||
}
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}border-color);
|
||||
}
|
||||
}
|
||||
|
||||
// Aria-invalid
|
||||
#{$parent-selector} :not([novalidate]) [type="checkbox"],
|
||||
#{$parent-selector} :not([novalidate]) [type="checkbox"][role="switch"] {
|
||||
&[aria-invalid="false"] {
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
}
|
||||
}
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
&[aria-invalid="true"] {
|
||||
#{$css-var-prefix}background-color: var(
|
||||
#{$css-var-prefix}form-element-invalid-border-color
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#{$parent-selector} :not([novalidate]) [type="checkbox"],
|
||||
#{$parent-selector} :not([novalidate]) [type="radio"],
|
||||
#{$parent-selector} :not([novalidate]) [type="checkbox"][role="switch"] {
|
||||
&[aria-invalid="false"] {
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
}
|
||||
}
|
||||
&:checked,
|
||||
&:checked:active,
|
||||
&:checked:focus {
|
||||
&[aria-invalid="true"] {
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,74 +1,74 @@
|
|||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/floating") {
|
||||
// and $enable-classes {
|
||||
$transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
#{$parent-selector} section[role="form"] {
|
||||
position: relative;
|
||||
margin-bottom: 0;
|
||||
|
||||
> input::placeholder,
|
||||
> textarea::placeholder {
|
||||
color: rgba(0, 0, 0, 0);
|
||||
transition: color $transition-fast;
|
||||
}
|
||||
|
||||
> input:focus::placeholder,
|
||||
> textarea:focus::placeholder {
|
||||
color: var(--pico-form-element-placeholder-color);
|
||||
}
|
||||
|
||||
> input + label,
|
||||
> textarea + label,
|
||||
> select + label {
|
||||
position: absolute;
|
||||
top: 35%;
|
||||
left: 0.8rem;
|
||||
transform: translateY(-50%);
|
||||
background: var(#{$css-var-prefix}form-element-background-color);
|
||||
color: var(#{$css-var-prefix}form-element-placeholder-color);
|
||||
cursor: text;
|
||||
transition: 0.3s ease;
|
||||
}
|
||||
|
||||
// Used this before I tried: >select:has(option:checked:not([disabled]))~label
|
||||
//> select + label {
|
||||
// position: absolute;
|
||||
// top: -5%;
|
||||
// left: 0.8rem;
|
||||
// padding: calc(var(--pico-spacing) * 0.25) calc(var(--pico-spacing) * 0.5);
|
||||
// transform: translateY(-50%) scale(0.85);
|
||||
// background: var(#{$css-var-prefix}form-element-background-color);
|
||||
// cursor: text;
|
||||
//}
|
||||
|
||||
> input:not(:placeholder-shown) + label,
|
||||
> input:focus + label,
|
||||
> textarea:not(:placeholder-shown) + label,
|
||||
> textarea:focus + label,
|
||||
> select:focus + label,
|
||||
> select:has(option:checked:not([disabled])) ~ label {
|
||||
top: -5%;
|
||||
padding: calc(var(--pico-spacing) * 0.25) calc(var(--pico-spacing) * 0.5);
|
||||
transform: translateY(-50%) scale(0.85);
|
||||
color: var(--pico-form-element-active-border-color);
|
||||
font-size: calc(var(--pico-font-size) * 0.85);
|
||||
line-height: 1.25;
|
||||
transition: all $transition-fast;
|
||||
}
|
||||
|
||||
@if map.get($modules, "forms/validation") {
|
||||
> input:user-invalid:not(:placeholder-shown) + label,
|
||||
> textarea:user-invalid:not(:placeholder-shown) + label {
|
||||
color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
|
||||
> input:user-valid:not(:placeholder-shown) + label,
|
||||
> textarea:user-valid:not(:placeholder-shown) + label {
|
||||
color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/floating") {
|
||||
// and $enable-classes {
|
||||
$transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
#{$parent-selector} section[role="form"] {
|
||||
position: relative;
|
||||
margin-bottom: 0;
|
||||
|
||||
> input::placeholder,
|
||||
> textarea::placeholder {
|
||||
color: rgba(0, 0, 0, 0);
|
||||
transition: color $transition-fast;
|
||||
}
|
||||
|
||||
> input:focus::placeholder,
|
||||
> textarea:focus::placeholder {
|
||||
color: var(--pico-form-element-placeholder-color);
|
||||
}
|
||||
|
||||
> input + label,
|
||||
> textarea + label,
|
||||
> select + label {
|
||||
position: absolute;
|
||||
top: 35%;
|
||||
left: 0.8rem;
|
||||
transform: translateY(-50%);
|
||||
background: var(#{$css-var-prefix}form-element-background-color);
|
||||
color: var(#{$css-var-prefix}form-element-placeholder-color);
|
||||
cursor: text;
|
||||
transition: 0.3s ease;
|
||||
}
|
||||
|
||||
// Used this before I tried: >select:has(option:checked:not([disabled]))~label
|
||||
//> select + label {
|
||||
// position: absolute;
|
||||
// top: -5%;
|
||||
// left: 0.8rem;
|
||||
// padding: calc(var(--pico-spacing) * 0.25) calc(var(--pico-spacing) * 0.5);
|
||||
// transform: translateY(-50%) scale(0.85);
|
||||
// background: var(#{$css-var-prefix}form-element-background-color);
|
||||
// cursor: text;
|
||||
//}
|
||||
|
||||
> input:not(:placeholder-shown) + label,
|
||||
> input:focus + label,
|
||||
> textarea:not(:placeholder-shown) + label,
|
||||
> textarea:focus + label,
|
||||
> select:focus + label,
|
||||
> select:has(option:checked:not([disabled])) ~ label {
|
||||
top: -5%;
|
||||
padding: calc(var(--pico-spacing) * 0.25) calc(var(--pico-spacing) * 0.5);
|
||||
transform: translateY(-50%) scale(0.85);
|
||||
color: var(--pico-form-element-active-border-color);
|
||||
font-size: calc(var(--pico-font-size) * 0.85);
|
||||
line-height: 1.25;
|
||||
transition: all $transition-fast;
|
||||
}
|
||||
|
||||
@if map.get($modules, "forms/validation") {
|
||||
> input:user-invalid:not(:placeholder-shown) + label,
|
||||
> textarea:user-invalid:not(:placeholder-shown) + label {
|
||||
color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
|
||||
> input:user-valid:not(:placeholder-shown) + label,
|
||||
> textarea:user-valid:not(:placeholder-shown) + label {
|
||||
color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
// Wrapper
|
||||
@mixin color-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
// Swatch
|
||||
@mixin color-swatch {
|
||||
border: 0;
|
||||
border-radius: calc(var(#{$css-var-prefix}border-radius) * 0.5);
|
||||
}
|
||||
|
||||
@if map.get($modules, "forms/input-color") {
|
||||
/**
|
||||
* Input type color
|
||||
*/
|
||||
|
||||
#{$parent-selector} [type="color"] {
|
||||
&::-webkit-color-swatch-wrapper {
|
||||
@include color-wrapper;
|
||||
}
|
||||
|
||||
&::-moz-focus-inner {
|
||||
@include color-wrapper;
|
||||
}
|
||||
|
||||
&::-webkit-color-swatch {
|
||||
@include color-swatch;
|
||||
}
|
||||
|
||||
&::-moz-color-swatch {
|
||||
@include color-swatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
// Wrapper
|
||||
@mixin color-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
// Swatch
|
||||
@mixin color-swatch {
|
||||
border: 0;
|
||||
border-radius: calc(var(#{$css-var-prefix}border-radius) * 0.5);
|
||||
}
|
||||
|
||||
@if map.get($modules, "forms/input-color") {
|
||||
/**
|
||||
* Input type color
|
||||
*/
|
||||
|
||||
#{$parent-selector} [type="color"] {
|
||||
&::-webkit-color-swatch-wrapper {
|
||||
@include color-wrapper;
|
||||
}
|
||||
|
||||
&::-moz-focus-inner {
|
||||
@include color-wrapper;
|
||||
}
|
||||
|
||||
&::-webkit-color-swatch {
|
||||
@include color-swatch;
|
||||
}
|
||||
|
||||
&::-moz-color-swatch {
|
||||
@include color-swatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,60 +1,60 @@
|
|||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/input-date") {
|
||||
/**
|
||||
* Input type datetime
|
||||
*/
|
||||
|
||||
// :not() are needed to add Specificity and avoid !important on padding
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]) {
|
||||
&:is([type="date"], [type="datetime-local"], [type="month"], [type="time"], [type="week"]) {
|
||||
#{$css-var-prefix}icon-position: 0.75rem;
|
||||
#{$css-var-prefix}icon-width: 1rem;
|
||||
padding-right: calc(var(#{$css-var-prefix}icon-width) + var(#{$css-var-prefix}icon-position));
|
||||
background-image: var(#{$css-var-prefix}icon-date);
|
||||
background-position: center right var(#{$css-var-prefix}icon-position);
|
||||
background-size: var(#{$css-var-prefix}icon-width) auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
// Time
|
||||
&[type="time"] {
|
||||
background-image: var(#{$css-var-prefix}icon-time);
|
||||
}
|
||||
}
|
||||
|
||||
// Calendar picker
|
||||
#{$parent-selector} [type="date"],
|
||||
#{$parent-selector} [type="datetime-local"],
|
||||
#{$parent-selector} [type="month"],
|
||||
#{$parent-selector} [type="time"],
|
||||
#{$parent-selector} [type="week"] {
|
||||
&::-webkit-calendar-picker-indicator {
|
||||
width: var(#{$css-var-prefix}icon-width);
|
||||
margin-right: calc(var(#{$css-var-prefix}icon-width) * -1);
|
||||
margin-left: var(#{$css-var-prefix}icon-position);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Calendar icons are hidden in Firefox
|
||||
@if $enable-important {
|
||||
@-moz-document url-prefix() {
|
||||
#{$parent-selector} [type="date"],
|
||||
#{$parent-selector} [type="datetime-local"],
|
||||
#{$parent-selector} [type="month"],
|
||||
#{$parent-selector} [type="time"],
|
||||
#{$parent-selector} [type="week"] {
|
||||
padding-right: var(#{$css-var-prefix}form-element-spacing-horizontal) !important;
|
||||
background-image: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"]
|
||||
#{$parent-selector}
|
||||
:is([type="date"], [type="datetime-local"], [type="month"], [type="time"], [type="week"]) {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/input-date") {
|
||||
/**
|
||||
* Input type datetime
|
||||
*/
|
||||
|
||||
// :not() are needed to add Specificity and avoid !important on padding
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]) {
|
||||
&:is([type="date"], [type="datetime-local"], [type="month"], [type="time"], [type="week"]) {
|
||||
#{$css-var-prefix}icon-position: 0.75rem;
|
||||
#{$css-var-prefix}icon-width: 1rem;
|
||||
padding-right: calc(var(#{$css-var-prefix}icon-width) + var(#{$css-var-prefix}icon-position));
|
||||
background-image: var(#{$css-var-prefix}icon-date);
|
||||
background-position: center right var(#{$css-var-prefix}icon-position);
|
||||
background-size: var(#{$css-var-prefix}icon-width) auto;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
// Time
|
||||
&[type="time"] {
|
||||
background-image: var(#{$css-var-prefix}icon-time);
|
||||
}
|
||||
}
|
||||
|
||||
// Calendar picker
|
||||
#{$parent-selector} [type="date"],
|
||||
#{$parent-selector} [type="datetime-local"],
|
||||
#{$parent-selector} [type="month"],
|
||||
#{$parent-selector} [type="time"],
|
||||
#{$parent-selector} [type="week"] {
|
||||
&::-webkit-calendar-picker-indicator {
|
||||
width: var(#{$css-var-prefix}icon-width);
|
||||
margin-right: calc(var(#{$css-var-prefix}icon-width) * -1);
|
||||
margin-left: var(#{$css-var-prefix}icon-position);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Calendar icons are hidden in Firefox
|
||||
@if $enable-important {
|
||||
@-moz-document url-prefix() {
|
||||
#{$parent-selector} [type="date"],
|
||||
#{$parent-selector} [type="datetime-local"],
|
||||
#{$parent-selector} [type="month"],
|
||||
#{$parent-selector} [type="time"],
|
||||
#{$parent-selector} [type="week"] {
|
||||
padding-right: var(#{$css-var-prefix}form-element-spacing-horizontal) !important;
|
||||
background-image: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"]
|
||||
#{$parent-selector}
|
||||
:is([type="date"], [type="datetime-local"], [type="month"], [type="time"], [type="week"]) {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/input-file") {
|
||||
/**
|
||||
* Input type file
|
||||
*/
|
||||
|
||||
// 1. Hack to display the outline on the focused file selector button
|
||||
// with the forced overflow hidden on the input[type="file"] element.
|
||||
#{$parent-selector} [type="file"] {
|
||||
#{$css-var-prefix}color: var(#{$css-var-prefix}muted-color);
|
||||
margin-left: calc(var(#{$css-var-prefix}outline-width) * -1); // 1
|
||||
padding: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5) 0;
|
||||
padding-left: var(#{$css-var-prefix}outline-width); // 1
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: none;
|
||||
|
||||
&::file-selector-button {
|
||||
margin-right: calc(var(#{$css-var-prefix}spacing) / 2);
|
||||
padding: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5)
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
}
|
||||
|
||||
&:is(:hover, :active, :focus) {
|
||||
&::file-selector-button {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}secondary-hover-background);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}secondary-hover-border);
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
&::file-selector-button {
|
||||
#{$css-var-prefix}box-shadow:
|
||||
var(#{$css-var-prefix}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
|
||||
0 0 0 var(#{$css-var-prefix}outline-width) var(#{$css-var-prefix}secondary-focus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/input-file") {
|
||||
/**
|
||||
* Input type file
|
||||
*/
|
||||
|
||||
// 1. Hack to display the outline on the focused file selector button
|
||||
// with the forced overflow hidden on the input[type="file"] element.
|
||||
#{$parent-selector} [type="file"] {
|
||||
#{$css-var-prefix}color: var(#{$css-var-prefix}muted-color);
|
||||
margin-left: calc(var(#{$css-var-prefix}outline-width) * -1); // 1
|
||||
padding: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5) 0;
|
||||
padding-left: var(#{$css-var-prefix}outline-width); // 1
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: none;
|
||||
|
||||
&::file-selector-button {
|
||||
margin-right: calc(var(#{$css-var-prefix}spacing) / 2);
|
||||
padding: calc(var(#{$css-var-prefix}form-element-spacing-vertical) * 0.5)
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal);
|
||||
}
|
||||
|
||||
&:is(:hover, :active, :focus) {
|
||||
&::file-selector-button {
|
||||
#{$css-var-prefix}background-color: var(#{$css-var-prefix}secondary-hover-background);
|
||||
#{$css-var-prefix}border-color: var(#{$css-var-prefix}secondary-hover-border);
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
&::file-selector-button {
|
||||
#{$css-var-prefix}box-shadow:
|
||||
var(#{$css-var-prefix}button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
|
||||
0 0 0 var(#{$css-var-prefix}outline-width) var(#{$css-var-prefix}secondary-focus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,100 +1,100 @@
|
|||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
// Config
|
||||
$height-track: 0.375rem;
|
||||
$height-thumb: 1.25rem;
|
||||
$border-thumb: 2px;
|
||||
|
||||
// Slider Track
|
||||
@mixin slider-track {
|
||||
width: 100%;
|
||||
height: $height-track;
|
||||
border-radius: var(#{$css-var-prefix}border-radius);
|
||||
background-color: var(#{$css-var-prefix}range-border-color);
|
||||
|
||||
@if $enable-transitions {
|
||||
transition:
|
||||
background-color var(#{$css-var-prefix}transition),
|
||||
box-shadow var(#{$css-var-prefix}transition);
|
||||
}
|
||||
}
|
||||
|
||||
// Slider Thumb
|
||||
@mixin slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
width: $height-thumb;
|
||||
height: $height-thumb;
|
||||
margin-top: #{(-($height-thumb * 0.5) + ($height-track * 0.5))};
|
||||
border: $border-thumb solid var(#{$css-var-prefix}range-thumb-border-color);
|
||||
border-radius: 50%;
|
||||
background-color: var(#{$css-var-prefix}range-thumb-color);
|
||||
cursor: pointer;
|
||||
|
||||
@if $enable-transitions {
|
||||
transition:
|
||||
background-color var(#{$css-var-prefix}transition),
|
||||
transform var(#{$css-var-prefix}transition);
|
||||
}
|
||||
}
|
||||
|
||||
@if map.get($modules, "forms/input-range") {
|
||||
/**
|
||||
* Input type range
|
||||
*/
|
||||
|
||||
#{$parent-selector} [type="range"] {
|
||||
// Styles
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
width: 100%;
|
||||
height: $height-thumb;
|
||||
background: none;
|
||||
|
||||
&::-webkit-slider-runnable-track {
|
||||
@include slider-track;
|
||||
}
|
||||
|
||||
&::-moz-range-track {
|
||||
@include slider-track;
|
||||
}
|
||||
|
||||
&::-ms-track {
|
||||
@include slider-track;
|
||||
}
|
||||
|
||||
&::-webkit-slider-thumb {
|
||||
@include slider-thumb;
|
||||
}
|
||||
|
||||
&::-moz-range-thumb {
|
||||
@include slider-thumb;
|
||||
}
|
||||
|
||||
&::-ms-thumb {
|
||||
@include slider-thumb;
|
||||
}
|
||||
|
||||
&:active,
|
||||
&:focus-within {
|
||||
#{$css-var-prefix}range-border-color: var(#{$css-var-prefix}range-active-border-color);
|
||||
#{$css-var-prefix}range-thumb-color: var(#{$css-var-prefix}range-thumb-active-color);
|
||||
}
|
||||
|
||||
&:active {
|
||||
// Slider Thumb
|
||||
&::-webkit-slider-thumb {
|
||||
transform: scale(1.25);
|
||||
}
|
||||
|
||||
&::-moz-range-thumb {
|
||||
transform: scale(1.25);
|
||||
}
|
||||
|
||||
&::-ms-thumb {
|
||||
transform: scale(1.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
// Config
|
||||
$height-track: 0.375rem;
|
||||
$height-thumb: 1.25rem;
|
||||
$border-thumb: 2px;
|
||||
|
||||
// Slider Track
|
||||
@mixin slider-track {
|
||||
width: 100%;
|
||||
height: $height-track;
|
||||
border-radius: var(#{$css-var-prefix}border-radius);
|
||||
background-color: var(#{$css-var-prefix}range-border-color);
|
||||
|
||||
@if $enable-transitions {
|
||||
transition:
|
||||
background-color var(#{$css-var-prefix}transition),
|
||||
box-shadow var(#{$css-var-prefix}transition);
|
||||
}
|
||||
}
|
||||
|
||||
// Slider Thumb
|
||||
@mixin slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
width: $height-thumb;
|
||||
height: $height-thumb;
|
||||
margin-top: #{(-($height-thumb * 0.5) + ($height-track * 0.5))};
|
||||
border: $border-thumb solid var(#{$css-var-prefix}range-thumb-border-color);
|
||||
border-radius: 50%;
|
||||
background-color: var(#{$css-var-prefix}range-thumb-color);
|
||||
cursor: pointer;
|
||||
|
||||
@if $enable-transitions {
|
||||
transition:
|
||||
background-color var(#{$css-var-prefix}transition),
|
||||
transform var(#{$css-var-prefix}transition);
|
||||
}
|
||||
}
|
||||
|
||||
@if map.get($modules, "forms/input-range") {
|
||||
/**
|
||||
* Input type range
|
||||
*/
|
||||
|
||||
#{$parent-selector} [type="range"] {
|
||||
// Styles
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
width: 100%;
|
||||
height: $height-thumb;
|
||||
background: none;
|
||||
|
||||
&::-webkit-slider-runnable-track {
|
||||
@include slider-track;
|
||||
}
|
||||
|
||||
&::-moz-range-track {
|
||||
@include slider-track;
|
||||
}
|
||||
|
||||
&::-ms-track {
|
||||
@include slider-track;
|
||||
}
|
||||
|
||||
&::-webkit-slider-thumb {
|
||||
@include slider-thumb;
|
||||
}
|
||||
|
||||
&::-moz-range-thumb {
|
||||
@include slider-thumb;
|
||||
}
|
||||
|
||||
&::-ms-thumb {
|
||||
@include slider-thumb;
|
||||
}
|
||||
|
||||
&:active,
|
||||
&:focus-within {
|
||||
#{$css-var-prefix}range-border-color: var(#{$css-var-prefix}range-active-border-color);
|
||||
#{$css-var-prefix}range-thumb-color: var(#{$css-var-prefix}range-thumb-active-color);
|
||||
}
|
||||
|
||||
&:active {
|
||||
// Slider Thumb
|
||||
&::-webkit-slider-thumb {
|
||||
transform: scale(1.25);
|
||||
}
|
||||
|
||||
&::-moz-range-thumb {
|
||||
transform: scale(1.25);
|
||||
}
|
||||
|
||||
&::-ms-thumb {
|
||||
transform: scale(1.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,60 +1,60 @@
|
|||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/input-search") {
|
||||
/**
|
||||
* Input type search
|
||||
*/
|
||||
|
||||
// :not() are needed to add Specificity and avoid !important on padding
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]) {
|
||||
&[type="search"] {
|
||||
padding-inline-start: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.75rem);
|
||||
background-image: var(#{$css-var-prefix}icon-search);
|
||||
background-position: center
|
||||
left
|
||||
calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 0.125rem);
|
||||
background-size: 1rem auto;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
&[aria-invalid] {
|
||||
@if $enable-important {
|
||||
padding-inline-start: calc(
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.75rem
|
||||
) !important;
|
||||
} @else {
|
||||
padding-inline-start: calc(
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.75rem
|
||||
);
|
||||
}
|
||||
background-position:
|
||||
center left 1.125rem,
|
||||
center right 0.75rem;
|
||||
}
|
||||
|
||||
&[aria-invalid="false"] {
|
||||
background-image: var(#{$css-var-prefix}icon-search), var(#{$css-var-prefix}icon-valid);
|
||||
}
|
||||
|
||||
&[aria-invalid="true"] {
|
||||
background-image: var(#{$css-var-prefix}icon-search), var(#{$css-var-prefix}icon-invalid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] {
|
||||
#{$parent-selector} :where(input) {
|
||||
&:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]) {
|
||||
&[type="search"] {
|
||||
background-position: center right 1.125rem;
|
||||
|
||||
&[aria-invalid] {
|
||||
background-position:
|
||||
center right 1.125rem,
|
||||
center left 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/input-search") {
|
||||
/**
|
||||
* Input type search
|
||||
*/
|
||||
|
||||
// :not() are needed to add Specificity and avoid !important on padding
|
||||
#{$parent-selector} input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]) {
|
||||
&[type="search"] {
|
||||
padding-inline-start: calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.75rem);
|
||||
background-image: var(#{$css-var-prefix}icon-search);
|
||||
background-position: center
|
||||
left
|
||||
calc(var(#{$css-var-prefix}form-element-spacing-horizontal) + 0.125rem);
|
||||
background-size: 1rem auto;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
&[aria-invalid] {
|
||||
@if $enable-important {
|
||||
padding-inline-start: calc(
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.75rem
|
||||
) !important;
|
||||
} @else {
|
||||
padding-inline-start: calc(
|
||||
var(#{$css-var-prefix}form-element-spacing-horizontal) + 1.75rem
|
||||
);
|
||||
}
|
||||
background-position:
|
||||
center left 1.125rem,
|
||||
center right 0.75rem;
|
||||
}
|
||||
|
||||
&[aria-invalid="false"] {
|
||||
background-image: var(#{$css-var-prefix}icon-search), var(#{$css-var-prefix}icon-valid);
|
||||
}
|
||||
|
||||
&[aria-invalid="true"] {
|
||||
background-image: var(#{$css-var-prefix}icon-search), var(#{$css-var-prefix}icon-invalid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] {
|
||||
#{$parent-selector} :where(input) {
|
||||
&:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]) {
|
||||
&[type="search"] {
|
||||
background-position: center right 1.125rem;
|
||||
|
||||
&[aria-invalid] {
|
||||
background-position:
|
||||
center right 1.125rem,
|
||||
center left 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,244 +1,244 @@
|
|||
@use "sass:map";
|
||||
@use "../colors/index" as *;
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/validation") {
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-valid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
),
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-invalid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
) {
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
background-position: right calc(0.375em + 0.1875rem) center;
|
||||
background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) select:user-valid:not([multiple], [size]),
|
||||
#{$parent-selector} form:not([novalidate]) select:user-invalid:not([multiple], [size]) {
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
padding-right: 4.2rem;
|
||||
background-position:
|
||||
right 0.75rem center,
|
||||
center right 2.25rem;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) select:user-invalid:not([multiple], [size]) {
|
||||
background-image: var(#{$css-var-prefix}icon-chevron), var(#{$css-var-prefix}icon-invalid);
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) select:user-valid:not([multiple], [size]) {
|
||||
background-image: var(#{$css-var-prefix}icon-chevron), var(#{$css-var-prefix}icon-valid);
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) textarea:user-valid:not(:placeholder-shown),
|
||||
#{$parent-selector} form:not([novalidate]) textarea:user-invalid:not(:placeholder-shown) {
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem);
|
||||
background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-invalid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
),
|
||||
#{$parent-selector} form:not([novalidate]) select:user-invalid:not([multiple], [size]),
|
||||
#{$parent-selector} form:not([novalidate]) textarea:user-invalid:not(:placeholder-shown) {
|
||||
border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
background-image: var(#{$css-var-prefix}icon-invalid);
|
||||
|
||||
&:focus {
|
||||
border-color: var(#{$css-var-prefix}form-element-invalid-active-border-color);
|
||||
}
|
||||
}
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-valid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
),
|
||||
#{$parent-selector} form:not([novalidate]) select:user-valid:not([multiple], [size]),
|
||||
#{$parent-selector} form:not([novalidate]) textarea:user-valid:not(:placeholder-shown) {
|
||||
border-color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
background-image: var(#{$css-var-prefix}icon-valid);
|
||||
|
||||
&:focus {
|
||||
border-color: var(#{$css-var-prefix}form-element-valid-active-border-color);
|
||||
}
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) input:required:user-invalid:is([type="checkbox"]) {
|
||||
border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-valid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
)
|
||||
+ small[data-valid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
select:user-valid:not([multiple], [size])
|
||||
+ small[data-valid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
textarea:user-valid:not(:placeholder-shown)
|
||||
+ small[data-valid]::after {
|
||||
content: attr(data-valid);
|
||||
color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
}
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
textarea:user-invalid:not(:placeholder-shown)
|
||||
+ small[data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
select:user-invalid:not([multiple], [size])
|
||||
+ small[data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-invalid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
)
|
||||
+ [data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input[type="file"]:user-invalid
|
||||
+ ul
|
||||
+ [data-invalid]::after {
|
||||
content: attr(data-invalid);
|
||||
color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-valid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
)
|
||||
+ [data-valid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-invalid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
)
|
||||
+ [data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
textarea:user-valid:not(:placeholder-shown)
|
||||
+ [data-valid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input[type="file"]:user-invalid
|
||||
+ [data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input[type="file"]:user-invalid
|
||||
+ ul
|
||||
+ [data-invalid]::after {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input[type="file"]:user-invalid
|
||||
+ ul
|
||||
+ [data-invalid]::after {
|
||||
position: relative;
|
||||
top: -2rem;
|
||||
}
|
||||
// the file btn
|
||||
#{$parent-selector} form:not([novalidate]) input[type="file"]:user-invalid::file-selector-button {
|
||||
border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
background-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
|
||||
/* File list when selected from the file input */
|
||||
#{$parent-selector} .file-list {
|
||||
padding-left: 0;
|
||||
li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
list-style-type: none;
|
||||
text-align: center;
|
||||
|
||||
&:nth-child(2n) {
|
||||
background-color: $grey-900;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(#{$css-var-prefix}muted-border-color);
|
||||
}
|
||||
|
||||
.btn-file-rm {
|
||||
display: inline-block;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
margin-right: 10px;
|
||||
padding: 0;
|
||||
padding-top: calc(var(#{$css-var-prefix}spacing) * 0.25);
|
||||
border: none;
|
||||
background-image: var(#{$css-var-prefix}icon-red-close);
|
||||
background-position: center;
|
||||
background-size: 1rem;
|
||||
background-repeat: no-repeat;
|
||||
background-color: transparent;
|
||||
color: var(#{$css-var-prefix}element-invalid-border-color);
|
||||
opacity: 0.5;
|
||||
transition: opacity var(#{$css-var-prefix}transition);
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "sass:map";
|
||||
@use "../colors/index" as *;
|
||||
@use "../settings" as *;
|
||||
|
||||
@if map.get($modules, "forms/validation") {
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-valid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
),
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-invalid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
) {
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
background-position: right calc(0.375em + 0.1875rem) center;
|
||||
background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) select:user-valid:not([multiple], [size]),
|
||||
#{$parent-selector} form:not([novalidate]) select:user-invalid:not([multiple], [size]) {
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
padding-right: 4.2rem;
|
||||
background-position:
|
||||
right 0.75rem center,
|
||||
center right 2.25rem;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) select:user-invalid:not([multiple], [size]) {
|
||||
background-image: var(#{$css-var-prefix}icon-chevron), var(#{$css-var-prefix}icon-invalid);
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) select:user-valid:not([multiple], [size]) {
|
||||
background-image: var(#{$css-var-prefix}icon-chevron), var(#{$css-var-prefix}icon-valid);
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) textarea:user-valid:not(:placeholder-shown),
|
||||
#{$parent-selector} form:not([novalidate]) textarea:user-invalid:not(:placeholder-shown) {
|
||||
padding-right: calc(1.5em + 0.75rem);
|
||||
background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem);
|
||||
background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-invalid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
),
|
||||
#{$parent-selector} form:not([novalidate]) select:user-invalid:not([multiple], [size]),
|
||||
#{$parent-selector} form:not([novalidate]) textarea:user-invalid:not(:placeholder-shown) {
|
||||
border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
background-image: var(#{$css-var-prefix}icon-invalid);
|
||||
|
||||
&:focus {
|
||||
border-color: var(#{$css-var-prefix}form-element-invalid-active-border-color);
|
||||
}
|
||||
}
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-valid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
),
|
||||
#{$parent-selector} form:not([novalidate]) select:user-valid:not([multiple], [size]),
|
||||
#{$parent-selector} form:not([novalidate]) textarea:user-valid:not(:placeholder-shown) {
|
||||
border-color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
background-image: var(#{$css-var-prefix}icon-valid);
|
||||
|
||||
&:focus {
|
||||
border-color: var(#{$css-var-prefix}form-element-valid-active-border-color);
|
||||
}
|
||||
}
|
||||
#{$parent-selector} form:not([novalidate]) input:required:user-invalid:is([type="checkbox"]) {
|
||||
border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-valid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
)
|
||||
+ small[data-valid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
select:user-valid:not([multiple], [size])
|
||||
+ small[data-valid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
textarea:user-valid:not(:placeholder-shown)
|
||||
+ small[data-valid]::after {
|
||||
content: attr(data-valid);
|
||||
color: var(#{$css-var-prefix}form-element-valid-border-color);
|
||||
}
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
textarea:user-invalid:not(:placeholder-shown)
|
||||
+ small[data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
select:user-invalid:not([multiple], [size])
|
||||
+ small[data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-invalid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
)
|
||||
+ [data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input[type="file"]:user-invalid
|
||||
+ ul
|
||||
+ [data-invalid]::after {
|
||||
content: attr(data-invalid);
|
||||
color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-valid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="image"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
)
|
||||
+ [data-valid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input:user-invalid:not(
|
||||
:placeholder-shown,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"],
|
||||
[type="checkbox"],
|
||||
[type="radio"]
|
||||
)
|
||||
+ [data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
textarea:user-valid:not(:placeholder-shown)
|
||||
+ [data-valid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input[type="file"]:user-invalid
|
||||
+ [data-invalid]::after,
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input[type="file"]:user-invalid
|
||||
+ ul
|
||||
+ [data-invalid]::after {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#{$parent-selector}
|
||||
form:not([novalidate])
|
||||
input[type="file"]:user-invalid
|
||||
+ ul
|
||||
+ [data-invalid]::after {
|
||||
position: relative;
|
||||
top: -2rem;
|
||||
}
|
||||
// the file btn
|
||||
#{$parent-selector} form:not([novalidate]) input[type="file"]:user-invalid::file-selector-button {
|
||||
border-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
background-color: var(#{$css-var-prefix}form-element-invalid-border-color);
|
||||
}
|
||||
|
||||
/* File list when selected from the file input */
|
||||
#{$parent-selector} .file-list {
|
||||
padding-left: 0;
|
||||
li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
list-style-type: none;
|
||||
text-align: center;
|
||||
|
||||
&:nth-child(2n) {
|
||||
background-color: $grey-900;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(#{$css-var-prefix}muted-border-color);
|
||||
}
|
||||
|
||||
.btn-file-rm {
|
||||
display: inline-block;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
margin-right: 10px;
|
||||
padding: 0;
|
||||
padding-top: calc(var(#{$css-var-prefix}spacing) * 0.25);
|
||||
border: none;
|
||||
background-image: var(#{$css-var-prefix}icon-red-close);
|
||||
background-position: center;
|
||||
background-size: 1rem;
|
||||
background-repeat: no-repeat;
|
||||
background-color: transparent;
|
||||
color: var(#{$css-var-prefix}element-invalid-border-color);
|
||||
opacity: 0.5;
|
||||
transition: opacity var(#{$css-var-prefix}transition);
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue