diff --git a/css/spruce.css b/css/spruce.css index 3e6d2ee..094f819 100644 --- a/css/spruce.css +++ b/css/spruce.css @@ -949,6 +949,18 @@ html[dir=rtl] .form-control--valid, html[dir=rtl] .form-control--invalid { padding: 0.75em 1em; } +select.form-control:not([multiple]):not([size]) { + background-image: url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M12,12.692l-5.203,-5.203c-0.234,-0.234 -0.614,-0.234 -0.849,0l-1.272,1.273c-0.235,0.234 -0.235,0.614 -0,0.849l6.9,6.9c0.234,0.234 0.614,0.234 0.848,-0l6.9,-6.9c0.235,-0.235 0.235,-0.615 0,-0.849l-1.272,-1.273c-0.235,-0.234 -0.615,-0.234 -0.849,0l-5.203,5.203Z" style="fill:%238660cd;"/%3e%3c/svg%3e'); + background-position: center right 0.5em; + background-repeat: no-repeat; + background-size: 1.25em auto; + -webkit-padding-end: 2em; + padding-inline-end: 2em; +} +html[dir=rtl] select.form-control:not([multiple]):not([size]) { + background-position: center left 0.5em; +} + .form-description { color: var(--spruce-form-color-text); display: block; @@ -1033,18 +1045,6 @@ legend { flex: 1 1 var(--col-width); } -select.form-control:not([multiple]):not([size]) { - background-image: url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M12,12.692l-5.203,-5.203c-0.234,-0.234 -0.614,-0.234 -0.849,0l-1.272,1.273c-0.235,0.234 -0.235,0.614 -0,0.849l6.9,6.9c0.234,0.234 0.614,0.234 0.848,-0l6.9,-6.9c0.235,-0.235 0.235,-0.615 0,-0.849l-1.272,-1.273c-0.235,-0.234 -0.615,-0.234 -0.849,0l-5.203,5.203Z" style="fill:%238660cd;"/%3e%3c/svg%3e'); - background-position: center right 0.5em; - background-repeat: no-repeat; - background-size: 1.25em auto; - -webkit-padding-end: 2em; - padding-inline-end: 2em; -} -html[dir=rtl] select.form-control:not([multiple]):not([size]) { - background-position: center left 0.5em; -} - .field-feedback { display: block; } diff --git a/css/spruce.min.css b/css/spruce.min.css index 439a076..a703ec7 100644 --- a/css/spruce.min.css +++ b/css/spruce.min.css @@ -1 +1 @@ -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spruce-base-color-primary: #8660cd;--spruce-base-color-secondary: #2350f6;--spruce-base-color-background: white;--spruce-base-color-heading: #00060a;--spruce-base-color-text: #474d52;--spruce-base-color-link: #8660cd;--spruce-base-color-link-hover: #663ab7;--spruce-base-color-border: #e6e6e6;--spruce-base-color-mark-background: #ffee99;--spruce-base-color-mark-foreground: #00060a;--spruce-base-color-code-background: #f0ecf9;--spruce-base-color-code-foreground: #00060a;--spruce-base-color-blockquote-border: #8660cd}:root{--spruce-selection-color-foreground: white;--spruce-selection-color-background: #8660cd}:root{--spruce-alert-color-danger: #db2929;--spruce-alert-color-info: #00a1d6;--spruce-alert-color-success: #00a854;--spruce-alert-color-warning: #f2ca26}:root{--spruce-btn-color-primary-background: #8660cd;--spruce-btn-color-primary-background-hover: #543097;--spruce-btn-color-primary-foreground: white;--spruce-btn-color-primary-foreground-hover: white;--spruce-btn-color-primary-shadow-focus: rgba(134, 96, 205, 0.25);--spruce-btn-color-secondary-background: #2350f6;--spruce-btn-color-secondary-background-hover: #072bab;--spruce-btn-color-secondary-foreground: white;--spruce-btn-color-secondary-foreground-hover: white;--spruce-btn-color-secondary-shadow-focus: rgba(35, 80, 246, 0.25)}:root{--spruce-form-color-background: white;--spruce-form-color-background-disabled: #f2f2f2;--spruce-form-color-border: #e6e6e6;--spruce-form-color-border-disabled: #e6e6e6;--spruce-form-color-border-focus: #8660cd;--spruce-form-color-shadow-focus: rgba(134, 96, 205, 0.25);--spruce-form-color-check-foreground: white;--spruce-form-color-check-background: #8660cd;--spruce-form-color-invalid: #db2929;--spruce-form-color-invalid-shadow: rgba(219, 41, 41, 0.25);--spruce-form-color-label: #00060a;--spruce-form-color-legend: #00060a;--spruce-form-color-placeholder: #5f666d;--spruce-form-color-text: #474d52;--spruce-form-color-select-foreground: #8660cd;--spruce-form-color-valid: #00a854;--spruce-form-color-valid-shadow: rgba(0, 168, 84, 0.25)}:root{--spruce-table-color-border: #e6e6e6;--spruce-table-color-caption: #474d52;--spruce-table-color-heading: #00060a;--spruce-table-color-hover: rgba(0, 0, 0, 0.05);--spruce-table-color-text: #474d52;--spruce-table-color-stripe: rgba(0, 0, 0, 0.025)}:root{--spruce-transition-duration: 0.15s;--spruce-transition-timing-function: ease-in-out}@media(prefers-reduced-motion: reduce){:root{--spruce-transition-duration: 0}}.sr-only{border:0 !important;clip:rect(0, 0, 0, 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;white-space:nowrap !important;width:1px !important}::-moz-selection{background-color:var(--spruce-selection-color-background);color:var(--spruce-selection-color-foreground);text-shadow:none}::selection{background-color:var(--spruce-selection-color-background);color:var(--spruce-selection-color-foreground);text-shadow:none}html{box-sizing:border-box}@media(prefers-reduced-motion: no-preference){html{scroll-behavior:smooth}}*,::before,::after{box-sizing:inherit}body{background:var(--spruce-base-color-background);color:var(--spruce-base-color-text)}a{color:var(--spruce-base-color-link);text-decoration:underline;transition:color var(--spruce-transition-duration) var(--spruce-transition-timing-function)}a:hover{color:var(--spruce-base-color-link-hover)}button{color:inherit}a,button{touch-action:manipulation}hr{border:0;border-top:1px solid var(--spruce-base-color-border)}img{display:block;height:auto;max-width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}iframe{display:block;height:100%;width:100%}figure{margin-left:0;margin-right:0}figure figcaption{margin-top:.5rem;text-align:center}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}.table-responsive table{min-width:40rem}.table{border-collapse:collapse;color:var(--spruce-table-color-text);width:100%}.table caption{color:var(--spruce-table-color-caption);margin-bottom:1rem}.table th,.table td{border-bottom:1px solid var(--spruce-table-color-border);line-height:1.5;padding:1rem}.table th{color:var(--spruce-table-color-heading);text-align:inherit;text-align:-webkit-match-parent}.table--striped>tbody>tr:nth-child(even){background-color:var(--spruce-table-color-stripe)}.table--hover>tbody>tr:hover{background:var(--spruce-table-color-hover)}.table--clear-border th,.table--clear-border td{border:0}.table--in-line th:first-child,.table--in-line td:first-child{-webkit-padding-start:0;padding-inline-start:0}.table--in-line th:last-child,.table--in-line td:last-child{-webkit-padding-end:0;padding-inline-end:0}.table--sm th,.table--sm td{padding:.25rem .5rem}.table--rounded th:first-child,.table--rounded td:first-child{border-start-start-radius:.5rem;border-end-start-radius:.5rem}.table--rounded th:last-child,.table--rounded td:last-child{border-start-end-radius:.5rem;border-end-end-radius:.5rem}body{font-family:system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, Liberation Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;font-size:1rem;line-height:1.8}p,li,h1,h2,h3,h4,h5,h6{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word}h1,h2,h3,h4,h5,h6{color:var(--spruce-base-color-heading);font-family:system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, Liberation Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;font-weight:700;line-height:calc(2px + 2ex + 2px)}h1,.h1{font-size:clamp(2.6837343406rem, 2vw + 1rem, 3.1573345183rem)}h2,.h2{font-size:clamp(2.0133040815rem, 2vw + 1rem, 2.368593037rem)}h3,.h3{font-size:clamp(1.51035565rem, 2vw + 1rem, 1.776889rem)}h4,.h4{font-size:clamp(1.13305rem, 2vw + 1rem, 1.333rem)}h5,.h5{font-size:1rem}h6,.h6{font-size:1rem}ul,ol{list-style-position:inside}ul>*,ol>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0}ul>*+*,ol>*+*{-webkit-margin-before:.25rem;margin-block-start:.25rem}ul li,ol li{list-style-position:outside}ul li::marker,ol li::marker{color:var(--spruce-base-color-primary)}li>ul,li>ol{margin-top:.25rem}dl dt{color:var(--spruce-base-color-heading);font-weight:bold}dl dd{margin:0}dl dd+dt{margin-top:1rem}blockquote{border-left:.5rem solid var(--spruce-base-color-blockquote-border);margin-left:0;padding:0 0 0 1.5rem}blockquote>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0;width:100%}blockquote>*+*{-webkit-margin-before:.5rem;margin-block-start:.5rem}blockquote cite{display:block}abbr[title]{border-bottom:1px dotted;cursor:help;text-decoration:none}mark{background-color:var(--spruce-base-color-mark-background);border-radius:.25rem;color:var(--spruce-base-color-mark-foreground);padding:.1em .3em}code,kbd,samp{background-color:var(--spruce-base-color-code-background);border-radius:.25rem;color:var(--spruce-base-color-code-foreground);padding:.1em .3em}.lead{font-size:1.333rem}.btn{align-items:center;border:0;border-radius:.25rem;cursor:pointer;display:inline-flex;font-size:1rem;font-weight:500;gap:.5rem;justify-content:center;line-height:1;padding:.75em 1em;text-align:start;text-decoration:none;transition:all var(--spruce-transition-duration) var(--spruce-transition-timing-function)}.btn:focus{outline-color:transparent;outline-style:solid}.btn:disabled,.btn--disabled{opacity:.5;pointer-events:none}.btn--icon{padding:.75em}.btn--icon.btn--sm{padding:.5em}.btn--icon.btn--lg{padding:.9em}.btn--sm{font-size:.8rem;padding:.5em}.btn--lg{padding:.9em 1.15em}@media(min-width: 64em){.btn--lg{font-size:1.15rem}}.btn--block{width:100%}.btn__icon{flex-shrink:0;height:1em;width:1em}.btn__icon--sm{height:.85em;width:.85em}.btn--primary{background-color:var(--spruce-btn-color-primary-background);color:var(--spruce-btn-color-primary-foreground)}.btn--primary:hover{background-color:var(--spruce-btn-color-primary-background-hover);color:var(--spruce-btn-color-primary-foreground-hover)}.btn--primary:focus{box-shadow:0 0 0 .25rem var(--spruce-btn-color-primary-shadow-focus);outline:2px solid transparent}.btn--secondary{background-color:var(--spruce-btn-color-secondary-background);color:var(--spruce-btn-color-secondary-foreground)}.btn--secondary:hover{background-color:var(--spruce-btn-color-secondary-background-hover);color:var(--spruce-btn-color-secondary-foreground-hover)}.btn--secondary:focus{box-shadow:0 0 0 .25rem var(--spruce-btn-color-secondary-shadow-focus);outline:2px solid transparent}.form-check{align-items:center;display:inline-flex}.form-check--sm .form-check__control{font-size:.9rem}.form-check--lg .form-check__control{font-size:1.1rem}.form-check__control{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--spruce-form-color-background);background-position:center;background-repeat:no-repeat;background-size:contain;border:1px solid var(--spruce-form-color-border);flex-shrink:0;font-size:1rem;height:1em;line-height:1;margin-bottom:-0.1em;-webkit-margin-end:.5rem;margin-inline-end:.5rem;transition:all var(--spruce-transition-duration) var(--spruce-transition-timing-function);width:1em}.form-check__control[type=radio]{border-radius:50%}.form-check__control[type=checkbox]{border-radius:.25rem}.form-check__control:focus{border-color:var(--spruce-form-color-border-focus);box-shadow:0 0 0 .25rem var(--spruce-form-color-shadow-focus);outline:2px solid transparent}.form-check__control:checked{background-color:var(--spruce-form-color-check-background);border-color:var(--spruce-form-color-check-background)}.form-check__control:checked[type=radio]{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3e%3ccircle cx="12" cy="12" r="6" style="fill:white;"/%3e%3c/svg%3e')}.form-check__control:checked[type=checkbox]{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M9.525,13.777l-2.411,-2.412c-0.234,-0.233 -0.613,-0.233 -0.846,0l-1.27,1.27c-0.233,0.233 -0.233,0.612 0,0.846l4.104,4.103c0.116,0.117 0.269,0.175 0.422,0.175l0.003,0c0.152,0 0.305,-0.058 0.421,-0.175l9.054,-9.053c0.233,-0.234 0.233,-0.613 -0,-0.846l-1.27,-1.269c-0.233,-0.234 -0.612,-0.234 -0.846,-0l-7.361,7.361Z" style="fill:white;"/%3e%3c/svg%3e')}.form-check__control:indeterminate[type=checkbox]{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M19.5,11.1c-0,-0.331 -0.269,-0.6 -0.6,-0.6l-13.8,0c-0.331,0 -0.6,0.269 -0.6,0.6l0,1.8c0,0.331 0.269,0.6 0.6,0.6l13.8,0c0.331,0 0.6,-0.269 0.6,-0.6l-0,-1.8Z" style="fill:white;"/%3e%3c/svg%3e');background-color:var(--spruce-form-color-check-background);border-color:var(--spruce-form-color-check-background)}.form-check__control:disabled{background-color:var(--spruce-form-color-background-disabled);border-color:var(--spruce-form-color-border-disabled);cursor:not-allowed}.form-check__control:disabled+.form-check__label{opacity:.5}.form-check__label{line-height:calc(2px + 2ex + 2px)}.form-control{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--spruce-form-color-background);border:1px solid var(--spruce-form-color-border);border-radius:.25rem;box-sizing:border-box;color:var(--spruce-form-color-text);display:block;font-size:1rem;line-height:1.5;padding:.5em .75em;transition:all var(--spruce-transition-duration) var(--spruce-transition-timing-function);width:100%}.form-control::-moz-placeholder{color:var(--spruce-form-color-placeholder)}.form-control:-ms-input-placeholder{color:var(--spruce-form-color-placeholder)}.form-control::placeholder{color:var(--spruce-form-color-placeholder)}.form-control:focus{border-color:var(--spruce-form-color-border-focus);box-shadow:0 0 0 .25rem var(--spruce-form-color-shadow-focus);outline:2px solid transparent}.form-control[disabled],.form-control[disabled=true]{background-color:var(--spruce-form-color-background-disabled);border-color:var(--spruce-form-color-border-disabled);cursor:not-allowed}.form-control--valid,.form-control--invalid{background-position:center right .5em;background-repeat:no-repeat;background-size:1.25em auto;-webkit-padding-end:2em;padding-inline-end:2em}html[dir=rtl] .form-control--valid,html[dir=rtl] .form-control--invalid{background-position:center left .5em}.form-control--valid{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"%3e%3cpath d="M12,2c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm0,1.667c4.599,-0 8.333,3.734 8.333,8.333c0,4.599 -3.734,8.333 -8.333,8.333c-4.599,0 -8.333,-3.734 -8.333,-8.333c-0,-4.599 3.734,-8.333 8.333,-8.333Zm-1.476,10.182l-2.984,-2.984c-0.065,-0.065 -0.17,-0.065 -0.235,0l-0.943,0.943c-0.065,0.065 -0.065,0.171 -0,0.236l4.043,4.042c0.033,0.033 0.076,0.05 0.119,0.049c0.044,0.001 0.087,-0.016 0.12,-0.049l6.994,-6.994c0.065,-0.065 0.065,-0.17 0,-0.235l-0.943,-0.943c-0.065,-0.065 -0.17,-0.065 -0.235,-0l-5.936,5.935Z" style="fill:%2300a854;"/%3e%3c/svg%3e');border-color:var(--spruce-alert-color-success)}.form-control--valid:focus{border-color:var(--spruce-form-color-valid);box-shadow:0 0 0 .25rem var(--spruce-form-color-valid-shadow);outline:2px solid transparent}.form-control--invalid{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"%3e%3cpath d="M12,2c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm0,1.667c4.599,-0 8.333,3.734 8.333,8.333c0,4.599 -3.734,8.333 -8.333,8.333c-4.599,0 -8.333,-3.734 -8.333,-8.333c-0,-4.599 3.734,-8.333 8.333,-8.333Zm0.813,11.649c-0,-0.081 -0.065,-0.146 -0.146,-0.146l-1.334,0c-0.081,0 -0.146,0.065 -0.146,0.146l0,1.169c0,0.08 0.065,0.146 0.146,0.146l1.334,-0c0.081,-0 0.146,-0.066 0.146,-0.146l-0,-1.169Zm-0,-7.784c-0,-0.09 -0.073,-0.163 -0.163,-0.163l-1.3,0c-0.09,0 -0.163,0.073 -0.163,0.163l0,6.351c0,0.09 0.073,0.163 0.163,0.163l1.3,-0c0.09,-0 0.163,-0.073 0.163,-0.163l-0,-6.351Z" style="fill:%23db2929;"/%3e%3c/svg%3e');border-color:var(--spruce-alert-color-danger)}.form-control--invalid:focus{border-color:var(--spruce-form-color-invalid);box-shadow:0 0 0 .25rem var(--spruce-form-color-invalid-shadow);outline:2px solid transparent}.form-control--sm{font-size:.9rem;padding:.25em .5em}.form-control--lg{font-size:1.1rem;padding:.75em 1em}.form-description{color:var(--spruce-form-color-text);display:block;font-size:1rem}fieldset{border:0;margin:0;padding:0}fieldset>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0;width:100%}fieldset>*+*{-webkit-margin-before:1rem;margin-block-start:1rem}fieldset+fieldset{margin-top:3rem}legend{color:var(--spruce-form-color-legend);font-size:clamp(1rem, 5vw, 1.333rem);font-weight:700}.form-group>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0}.form-group>*+*{-webkit-margin-before:.25rem;margin-block-start:.25rem}.form-group--vertical-check{display:flex;flex-direction:column;align-items:start}.form-group--vertical-check>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0}.form-group--vertical-check>*+*{-webkit-margin-before:.5rem;margin-block-start:.5rem}.form-group--grid{align-items:start;display:flex;flex-wrap:wrap;gap:.5rem}.form-label{color:var(--spruce-form-color-label)}.form-label--sm{font-size:.9rem}.form-label--lg{font-size:1.1rem}.form-row--mixed{--col-width: 20ch;display:flex;flex-wrap:wrap;gap:1rem}.form-row--mixed>*{flex:1 1 var(--col-width)}select.form-control:not([multiple]):not([size]){background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M12,12.692l-5.203,-5.203c-0.234,-0.234 -0.614,-0.234 -0.849,0l-1.272,1.273c-0.235,0.234 -0.235,0.614 -0,0.849l6.9,6.9c0.234,0.234 0.614,0.234 0.848,-0l6.9,-6.9c0.235,-0.235 0.235,-0.615 0,-0.849l-1.272,-1.273c-0.235,-0.234 -0.615,-0.234 -0.849,0l-5.203,5.203Z" style="fill:%238660cd;"/%3e%3c/svg%3e');background-position:center right .5em;background-repeat:no-repeat;background-size:1.25em auto;-webkit-padding-end:2em;padding-inline-end:2em}html[dir=rtl] select.form-control:not([multiple]):not([size]){background-position:center left .5em}.field-feedback{display:block}.field-feedback--valid{color:var(--spruce-alert-color-success)}.field-feedback--invalid{color:var(--spruce-alert-color-danger)} +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spruce-base-color-primary: #8660cd;--spruce-base-color-secondary: #2350f6;--spruce-base-color-background: white;--spruce-base-color-heading: #00060a;--spruce-base-color-text: #474d52;--spruce-base-color-link: #8660cd;--spruce-base-color-link-hover: #663ab7;--spruce-base-color-border: #e6e6e6;--spruce-base-color-mark-background: #ffee99;--spruce-base-color-mark-foreground: #00060a;--spruce-base-color-code-background: #f0ecf9;--spruce-base-color-code-foreground: #00060a;--spruce-base-color-blockquote-border: #8660cd}:root{--spruce-selection-color-foreground: white;--spruce-selection-color-background: #8660cd}:root{--spruce-alert-color-danger: #db2929;--spruce-alert-color-info: #00a1d6;--spruce-alert-color-success: #00a854;--spruce-alert-color-warning: #f2ca26}:root{--spruce-btn-color-primary-background: #8660cd;--spruce-btn-color-primary-background-hover: #543097;--spruce-btn-color-primary-foreground: white;--spruce-btn-color-primary-foreground-hover: white;--spruce-btn-color-primary-shadow-focus: rgba(134, 96, 205, 0.25);--spruce-btn-color-secondary-background: #2350f6;--spruce-btn-color-secondary-background-hover: #072bab;--spruce-btn-color-secondary-foreground: white;--spruce-btn-color-secondary-foreground-hover: white;--spruce-btn-color-secondary-shadow-focus: rgba(35, 80, 246, 0.25)}:root{--spruce-form-color-background: white;--spruce-form-color-background-disabled: #f2f2f2;--spruce-form-color-border: #e6e6e6;--spruce-form-color-border-disabled: #e6e6e6;--spruce-form-color-border-focus: #8660cd;--spruce-form-color-shadow-focus: rgba(134, 96, 205, 0.25);--spruce-form-color-check-foreground: white;--spruce-form-color-check-background: #8660cd;--spruce-form-color-invalid: #db2929;--spruce-form-color-invalid-shadow: rgba(219, 41, 41, 0.25);--spruce-form-color-label: #00060a;--spruce-form-color-legend: #00060a;--spruce-form-color-placeholder: #5f666d;--spruce-form-color-text: #474d52;--spruce-form-color-select-foreground: #8660cd;--spruce-form-color-valid: #00a854;--spruce-form-color-valid-shadow: rgba(0, 168, 84, 0.25)}:root{--spruce-table-color-border: #e6e6e6;--spruce-table-color-caption: #474d52;--spruce-table-color-heading: #00060a;--spruce-table-color-hover: rgba(0, 0, 0, 0.05);--spruce-table-color-text: #474d52;--spruce-table-color-stripe: rgba(0, 0, 0, 0.025)}:root{--spruce-transition-duration: 0.15s;--spruce-transition-timing-function: ease-in-out}@media(prefers-reduced-motion: reduce){:root{--spruce-transition-duration: 0}}.sr-only{border:0 !important;clip:rect(0, 0, 0, 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;white-space:nowrap !important;width:1px !important}::-moz-selection{background-color:var(--spruce-selection-color-background);color:var(--spruce-selection-color-foreground);text-shadow:none}::selection{background-color:var(--spruce-selection-color-background);color:var(--spruce-selection-color-foreground);text-shadow:none}html{box-sizing:border-box}@media(prefers-reduced-motion: no-preference){html{scroll-behavior:smooth}}*,::before,::after{box-sizing:inherit}body{background:var(--spruce-base-color-background);color:var(--spruce-base-color-text)}a{color:var(--spruce-base-color-link);text-decoration:underline;transition:color var(--spruce-transition-duration) var(--spruce-transition-timing-function)}a:hover{color:var(--spruce-base-color-link-hover)}button{color:inherit}a,button{touch-action:manipulation}hr{border:0;border-top:1px solid var(--spruce-base-color-border)}img{display:block;height:auto;max-width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}iframe{display:block;height:100%;width:100%}figure{margin-left:0;margin-right:0}figure figcaption{margin-top:.5rem;text-align:center}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}.table-responsive table{min-width:40rem}.table{border-collapse:collapse;color:var(--spruce-table-color-text);width:100%}.table caption{color:var(--spruce-table-color-caption);margin-bottom:1rem}.table th,.table td{border-bottom:1px solid var(--spruce-table-color-border);line-height:1.5;padding:1rem}.table th{color:var(--spruce-table-color-heading);text-align:inherit;text-align:-webkit-match-parent}.table--striped>tbody>tr:nth-child(even){background-color:var(--spruce-table-color-stripe)}.table--hover>tbody>tr:hover{background:var(--spruce-table-color-hover)}.table--clear-border th,.table--clear-border td{border:0}.table--in-line th:first-child,.table--in-line td:first-child{-webkit-padding-start:0;padding-inline-start:0}.table--in-line th:last-child,.table--in-line td:last-child{-webkit-padding-end:0;padding-inline-end:0}.table--sm th,.table--sm td{padding:.25rem .5rem}.table--rounded th:first-child,.table--rounded td:first-child{border-start-start-radius:.5rem;border-end-start-radius:.5rem}.table--rounded th:last-child,.table--rounded td:last-child{border-start-end-radius:.5rem;border-end-end-radius:.5rem}body{font-family:system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, Liberation Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;font-size:1rem;line-height:1.8}p,li,h1,h2,h3,h4,h5,h6{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word}h1,h2,h3,h4,h5,h6{color:var(--spruce-base-color-heading);font-family:system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, Liberation Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;font-weight:700;line-height:calc(2px + 2ex + 2px)}h1,.h1{font-size:clamp(2.6837343406rem, 2vw + 1rem, 3.1573345183rem)}h2,.h2{font-size:clamp(2.0133040815rem, 2vw + 1rem, 2.368593037rem)}h3,.h3{font-size:clamp(1.51035565rem, 2vw + 1rem, 1.776889rem)}h4,.h4{font-size:clamp(1.13305rem, 2vw + 1rem, 1.333rem)}h5,.h5{font-size:1rem}h6,.h6{font-size:1rem}ul,ol{list-style-position:inside}ul>*,ol>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0}ul>*+*,ol>*+*{-webkit-margin-before:.25rem;margin-block-start:.25rem}ul li,ol li{list-style-position:outside}ul li::marker,ol li::marker{color:var(--spruce-base-color-primary)}li>ul,li>ol{margin-top:.25rem}dl dt{color:var(--spruce-base-color-heading);font-weight:bold}dl dd{margin:0}dl dd+dt{margin-top:1rem}blockquote{border-left:.5rem solid var(--spruce-base-color-blockquote-border);margin-left:0;padding:0 0 0 1.5rem}blockquote>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0;width:100%}blockquote>*+*{-webkit-margin-before:.5rem;margin-block-start:.5rem}blockquote cite{display:block}abbr[title]{border-bottom:1px dotted;cursor:help;text-decoration:none}mark{background-color:var(--spruce-base-color-mark-background);border-radius:.25rem;color:var(--spruce-base-color-mark-foreground);padding:.1em .3em}code,kbd,samp{background-color:var(--spruce-base-color-code-background);border-radius:.25rem;color:var(--spruce-base-color-code-foreground);padding:.1em .3em}.lead{font-size:1.333rem}.btn{align-items:center;border:0;border-radius:.25rem;cursor:pointer;display:inline-flex;font-size:1rem;font-weight:500;gap:.5rem;justify-content:center;line-height:1;padding:.75em 1em;text-align:start;text-decoration:none;transition:all var(--spruce-transition-duration) var(--spruce-transition-timing-function)}.btn:focus{outline-color:transparent;outline-style:solid}.btn:disabled,.btn--disabled{opacity:.5;pointer-events:none}.btn--icon{padding:.75em}.btn--icon.btn--sm{padding:.5em}.btn--icon.btn--lg{padding:.9em}.btn--sm{font-size:.8rem;padding:.5em}.btn--lg{padding:.9em 1.15em}@media(min-width: 64em){.btn--lg{font-size:1.15rem}}.btn--block{width:100%}.btn__icon{flex-shrink:0;height:1em;width:1em}.btn__icon--sm{height:.85em;width:.85em}.btn--primary{background-color:var(--spruce-btn-color-primary-background);color:var(--spruce-btn-color-primary-foreground)}.btn--primary:hover{background-color:var(--spruce-btn-color-primary-background-hover);color:var(--spruce-btn-color-primary-foreground-hover)}.btn--primary:focus{box-shadow:0 0 0 .25rem var(--spruce-btn-color-primary-shadow-focus);outline:2px solid transparent}.btn--secondary{background-color:var(--spruce-btn-color-secondary-background);color:var(--spruce-btn-color-secondary-foreground)}.btn--secondary:hover{background-color:var(--spruce-btn-color-secondary-background-hover);color:var(--spruce-btn-color-secondary-foreground-hover)}.btn--secondary:focus{box-shadow:0 0 0 .25rem var(--spruce-btn-color-secondary-shadow-focus);outline:2px solid transparent}.form-check{align-items:center;display:inline-flex}.form-check--sm .form-check__control{font-size:.9rem}.form-check--lg .form-check__control{font-size:1.1rem}.form-check__control{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--spruce-form-color-background);background-position:center;background-repeat:no-repeat;background-size:contain;border:1px solid var(--spruce-form-color-border);flex-shrink:0;font-size:1rem;height:1em;line-height:1;margin-bottom:-0.1em;-webkit-margin-end:.5rem;margin-inline-end:.5rem;transition:all var(--spruce-transition-duration) var(--spruce-transition-timing-function);width:1em}.form-check__control[type=radio]{border-radius:50%}.form-check__control[type=checkbox]{border-radius:.25rem}.form-check__control:focus{border-color:var(--spruce-form-color-border-focus);box-shadow:0 0 0 .25rem var(--spruce-form-color-shadow-focus);outline:2px solid transparent}.form-check__control:checked{background-color:var(--spruce-form-color-check-background);border-color:var(--spruce-form-color-check-background)}.form-check__control:checked[type=radio]{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3e%3ccircle cx="12" cy="12" r="6" style="fill:white;"/%3e%3c/svg%3e')}.form-check__control:checked[type=checkbox]{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M9.525,13.777l-2.411,-2.412c-0.234,-0.233 -0.613,-0.233 -0.846,0l-1.27,1.27c-0.233,0.233 -0.233,0.612 0,0.846l4.104,4.103c0.116,0.117 0.269,0.175 0.422,0.175l0.003,0c0.152,0 0.305,-0.058 0.421,-0.175l9.054,-9.053c0.233,-0.234 0.233,-0.613 -0,-0.846l-1.27,-1.269c-0.233,-0.234 -0.612,-0.234 -0.846,-0l-7.361,7.361Z" style="fill:white;"/%3e%3c/svg%3e')}.form-check__control:indeterminate[type=checkbox]{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M19.5,11.1c-0,-0.331 -0.269,-0.6 -0.6,-0.6l-13.8,0c-0.331,0 -0.6,0.269 -0.6,0.6l0,1.8c0,0.331 0.269,0.6 0.6,0.6l13.8,0c0.331,0 0.6,-0.269 0.6,-0.6l-0,-1.8Z" style="fill:white;"/%3e%3c/svg%3e');background-color:var(--spruce-form-color-check-background);border-color:var(--spruce-form-color-check-background)}.form-check__control:disabled{background-color:var(--spruce-form-color-background-disabled);border-color:var(--spruce-form-color-border-disabled);cursor:not-allowed}.form-check__control:disabled+.form-check__label{opacity:.5}.form-check__label{line-height:calc(2px + 2ex + 2px)}.form-control{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--spruce-form-color-background);border:1px solid var(--spruce-form-color-border);border-radius:.25rem;box-sizing:border-box;color:var(--spruce-form-color-text);display:block;font-size:1rem;line-height:1.5;padding:.5em .75em;transition:all var(--spruce-transition-duration) var(--spruce-transition-timing-function);width:100%}.form-control::-moz-placeholder{color:var(--spruce-form-color-placeholder)}.form-control:-ms-input-placeholder{color:var(--spruce-form-color-placeholder)}.form-control::placeholder{color:var(--spruce-form-color-placeholder)}.form-control:focus{border-color:var(--spruce-form-color-border-focus);box-shadow:0 0 0 .25rem var(--spruce-form-color-shadow-focus);outline:2px solid transparent}.form-control[disabled],.form-control[disabled=true]{background-color:var(--spruce-form-color-background-disabled);border-color:var(--spruce-form-color-border-disabled);cursor:not-allowed}.form-control--valid,.form-control--invalid{background-position:center right .5em;background-repeat:no-repeat;background-size:1.25em auto;-webkit-padding-end:2em;padding-inline-end:2em}html[dir=rtl] .form-control--valid,html[dir=rtl] .form-control--invalid{background-position:center left .5em}.form-control--valid{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"%3e%3cpath d="M12,2c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm0,1.667c4.599,-0 8.333,3.734 8.333,8.333c0,4.599 -3.734,8.333 -8.333,8.333c-4.599,0 -8.333,-3.734 -8.333,-8.333c-0,-4.599 3.734,-8.333 8.333,-8.333Zm-1.476,10.182l-2.984,-2.984c-0.065,-0.065 -0.17,-0.065 -0.235,0l-0.943,0.943c-0.065,0.065 -0.065,0.171 -0,0.236l4.043,4.042c0.033,0.033 0.076,0.05 0.119,0.049c0.044,0.001 0.087,-0.016 0.12,-0.049l6.994,-6.994c0.065,-0.065 0.065,-0.17 0,-0.235l-0.943,-0.943c-0.065,-0.065 -0.17,-0.065 -0.235,-0l-5.936,5.935Z" style="fill:%2300a854;"/%3e%3c/svg%3e');border-color:var(--spruce-alert-color-success)}.form-control--valid:focus{border-color:var(--spruce-form-color-valid);box-shadow:0 0 0 .25rem var(--spruce-form-color-valid-shadow);outline:2px solid transparent}.form-control--invalid{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"%3e%3cpath d="M12,2c5.519,0 10,4.481 10,10c0,5.519 -4.481,10 -10,10c-5.519,0 -10,-4.481 -10,-10c0,-5.519 4.481,-10 10,-10Zm0,1.667c4.599,-0 8.333,3.734 8.333,8.333c0,4.599 -3.734,8.333 -8.333,8.333c-4.599,0 -8.333,-3.734 -8.333,-8.333c-0,-4.599 3.734,-8.333 8.333,-8.333Zm0.813,11.649c-0,-0.081 -0.065,-0.146 -0.146,-0.146l-1.334,0c-0.081,0 -0.146,0.065 -0.146,0.146l0,1.169c0,0.08 0.065,0.146 0.146,0.146l1.334,-0c0.081,-0 0.146,-0.066 0.146,-0.146l-0,-1.169Zm-0,-7.784c-0,-0.09 -0.073,-0.163 -0.163,-0.163l-1.3,0c-0.09,0 -0.163,0.073 -0.163,0.163l0,6.351c0,0.09 0.073,0.163 0.163,0.163l1.3,-0c0.09,-0 0.163,-0.073 0.163,-0.163l-0,-6.351Z" style="fill:%23db2929;"/%3e%3c/svg%3e');border-color:var(--spruce-alert-color-danger)}.form-control--invalid:focus{border-color:var(--spruce-form-color-invalid);box-shadow:0 0 0 .25rem var(--spruce-form-color-invalid-shadow);outline:2px solid transparent}.form-control--sm{font-size:.9rem;padding:.25em .5em}.form-control--lg{font-size:1.1rem;padding:.75em 1em}select.form-control:not([multiple]):not([size]){background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M12,12.692l-5.203,-5.203c-0.234,-0.234 -0.614,-0.234 -0.849,0l-1.272,1.273c-0.235,0.234 -0.235,0.614 -0,0.849l6.9,6.9c0.234,0.234 0.614,0.234 0.848,-0l6.9,-6.9c0.235,-0.235 0.235,-0.615 0,-0.849l-1.272,-1.273c-0.235,-0.234 -0.615,-0.234 -0.849,0l-5.203,5.203Z" style="fill:%238660cd;"/%3e%3c/svg%3e');background-position:center right .5em;background-repeat:no-repeat;background-size:1.25em auto;-webkit-padding-end:2em;padding-inline-end:2em}html[dir=rtl] select.form-control:not([multiple]):not([size]){background-position:center left .5em}.form-description{color:var(--spruce-form-color-text);display:block;font-size:1rem}fieldset{border:0;margin:0;padding:0}fieldset>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0;width:100%}fieldset>*+*{-webkit-margin-before:1rem;margin-block-start:1rem}fieldset+fieldset{margin-top:3rem}legend{color:var(--spruce-form-color-legend);font-size:clamp(1rem, 5vw, 1.333rem);font-weight:700}.form-group>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0}.form-group>*+*{-webkit-margin-before:.25rem;margin-block-start:.25rem}.form-group--vertical-check{display:flex;flex-direction:column;align-items:start}.form-group--vertical-check>*{-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0}.form-group--vertical-check>*+*{-webkit-margin-before:.5rem;margin-block-start:.5rem}.form-group--grid{align-items:start;display:flex;flex-wrap:wrap;gap:.5rem}.form-label{color:var(--spruce-form-color-label)}.form-label--sm{font-size:.9rem}.form-label--lg{font-size:1.1rem}.form-row--mixed{--col-width: 20ch;display:flex;flex-wrap:wrap;gap:1rem}.form-row--mixed>*{flex:1 1 var(--col-width)}.field-feedback{display:block}.field-feedback--valid{color:var(--spruce-alert-color-success)}.field-feedback--invalid{color:var(--spruce-alert-color-danger)} diff --git a/scss/form/_control.scss b/scss/form/_control.scss index 75cad82..529a0d7 100644 --- a/scss/form/_control.scss +++ b/scss/form/_control.scss @@ -3,8 +3,15 @@ @use '../mixin' as *; @use '../config' as *; -@mixin generate-form-control { - .form-control { +@mixin generate-form-control( + $input, + $has-states: false, + $has-sizes: false, + $has-select: true +) { + #{$input} { + $this: &; + appearance: none; background-color: color(background, form); border: $form-control-border-width solid color(border, form); @@ -38,51 +45,73 @@ ); } - &--valid, - &--invalid { - background-position: center right $select-icon-right-offset; - background-repeat: no-repeat; - background-size: $select-icon-width auto; - padding-inline-end: $select-padding-right; + // Validation states + @if ($has-states) { + &--valid, + &--invalid { + background-position: center right $select-icon-right-offset; + background-repeat: no-repeat; + background-size: $select-icon-width auto; + padding-inline-end: $select-padding-right; - html[dir='rtl'] & { - background-position: center left $select-icon-right-offset; + html[dir='rtl'] & { + background-position: center left $select-icon-right-offset; + } } - } - &--valid { - @include field-icon($form-valid-image, map.get($colors, alert, success)); - border-color: color(success, alert); + &--valid { + @include field-icon($form-valid-image, map.get($colors, alert, success)); + border-color: color(success, alert); - &:focus { - @include field-focus( - $border: color(valid, form), - $box-shadow: color(valid-shadow, form) - ); + &:focus { + @include field-focus( + $border: color(valid, form), + $box-shadow: color(valid-shadow, form) + ); + } } - } - &--invalid { - @include field-icon($form-invalid-image, map.get($colors, alert, danger)); - border-color: color(danger, alert); + &--invalid { + @include field-icon($form-invalid-image, map.get($colors, alert, danger)); + border-color: color(danger, alert); - &:focus { - @include field-focus( - $border: color(invalid, form), - $box-shadow: color(invalid-shadow, form) - ); + &:focus { + @include field-focus( + $border: color(invalid, form), + $box-shadow: color(invalid-shadow, form) + ); + } } } - //Sizes - &--sm { - font-size: $form-control-font-size-sm; - padding: $form-control-padding-sm; + // Sizes + @if ($has-sizes) { + &--sm { + font-size: $form-control-font-size-sm; + padding: $form-control-padding-sm; + } + + &--lg { + font-size: $form-control-font-size-lg; + padding: $form-control-padding-lg; + } } + } - &--lg { - font-size: $form-control-font-size-lg; - padding: $form-control-padding-lg; + // Generate select styling + @if ($has-select) { + select#{$input} { + &:not([multiple]):not([size]) { + @include field-icon($select-image, map.get($colors, form, select-foreground)); + background-position: center right $select-icon-right-offset; + background-repeat: no-repeat; + background-size: $select-icon-width auto; + padding-inline-end: $select-padding-right; + + html[dir='rtl'] & { + background-position: center left $select-icon-right-offset; + } + } } } } diff --git a/scss/form/_index.scss b/scss/form/_index.scss index 5eadcec..1055d54 100644 --- a/scss/form/_index.scss +++ b/scss/form/_index.scss @@ -6,5 +6,4 @@ @forward 'group'; @forward 'row'; @forward 'check'; -@forward 'select'; @forward 'validation'; diff --git a/scss/form/_select.scss b/scss/form/_select.scss deleted file mode 100644 index 1eabbc6..0000000 --- a/scss/form/_select.scss +++ /dev/null @@ -1,20 +0,0 @@ -@use 'sass:map'; -@use '../function' as *; -@use '../mixin' as *; -@use '../config' as *; - -@mixin generate-form-select { - select.form-control { - &:not([multiple]):not([size]) { - @include field-icon($select-image, map.get($colors, form, select-foreground)); - background-position: center right $select-icon-right-offset; - background-repeat: no-repeat; - background-size: $select-icon-width auto; - padding-inline-end: $select-padding-right; - - html[dir='rtl'] & { - background-position: center left $select-icon-right-offset; - } - } - } -} diff --git a/scss/mixin/_generator.scss b/scss/mixin/_generator.scss index 89167b3..14e0f94 100644 --- a/scss/mixin/_generator.scss +++ b/scss/mixin/_generator.scss @@ -24,12 +24,16 @@ '.form-check__label', true ); - @include generate-form-control; + @include generate-form-control( + '.form-control', + true, + true, + true + ); @include generate-form-description; @include generate-fieldset; @include generate-form-group; @include generate-form-label; @include generate-form-row; - @include generate-form-select; @include generate-field-feedback; }