geoproject-app/public/assets/css/src/_forms.scss

236 lines
4.5 KiB
SCSS
Raw Normal View History

select,
input[type="text"],
input[type="number"] {
2025-12-09 17:08:40 +01:00
height: var(--input-h);
2025-12-09 14:05:53 +01:00
border: 1px solid var(--color-interface-200);
background-color: var(--color-interface-100);
font-family: var(--sans-serif);
2025-12-11 13:38:27 +01:00
color: var(--color-txt);
2025-12-09 17:08:40 +01:00
font-size: 1rem;
2025-12-11 13:38:27 +01:00
padding-left: 0.5ch;
2026-03-07 18:51:08 +01:00
padding-right: 0.5ch;
}
2026-03-07 18:51:08 +01:00
input[type="number"]{
padding-left: 0.75ch;
}
2025-12-10 11:10:14 +01:00
2026-03-07 18:51:08 +01:00
select{
flex-grow: 1;
width: 100%;
}
2025-12-10 11:10:14 +01:00
2026-03-07 18:51:08 +01:00
.input-with-unit{
2025-12-10 11:10:14 +01:00
2026-03-07 18:51:08 +01:00
display: flex;
align-items: center;
gap: 0.5ch;
2025-12-10 11:10:14 +01:00
2026-03-07 18:51:08 +01:00
input[type="range"]{
flex-grow: 1;
margin-right: 1ch;
2025-12-10 11:10:14 +01:00
}
2026-03-07 18:51:08 +01:00
.number-input{
--input-w: 4ch;
flex-grow: 1;
max-width: calc(var(--input-w)*1.75);
display: flex;
align-items: center;
2025-12-10 11:10:14 +01:00
2026-03-07 18:51:08 +01:00
.number-input{
flex-grow: 1;
display: flex;
align-items: center;
2026-03-05 11:08:44 +01:00
2026-03-07 18:51:08 +01:00
}
input[type="number"]{
width: var(--input-w);
padding-right: calc(var(--input-w)*0.5);
2026-03-05 11:08:44 +01:00
2026-03-07 18:51:08 +01:00
}
2025-12-10 11:10:14 +01:00
}
2026-03-07 18:51:08 +01:00
.unit-toggle{
display: flex;
align-items: center;
gap: 0.25ch;
2025-12-11 13:38:27 +01:00
}
2026-03-07 18:51:08 +01:00
2025-12-11 13:38:27 +01:00
}
2026-03-07 18:51:08 +01:00
.field-checkbox{
display: flex;
align-items: center;
gap: 0.5ch;
input[type="checkbox"]{
accent-color: var(--color-interface-800);
2025-12-10 11:10:14 +01:00
}
}
2026-03-07 18:51:08 +01:00
/* Label with tooltip ---------------------------------------------- */
.label-with-tooltip {
2025-12-10 11:10:14 +01:00
text-decoration: underline dotted 1px var(--color-200);
text-underline-offset: 2px;
cursor: help;
position: relative;
&::after {
content: attr(data-css);
position: absolute;
bottom: 100%;
left: 0;
margin-bottom: 4px;
padding: 0.25rem 0.5rem;
2025-12-10 11:10:14 +01:00
background: var(--color-interface-700);
color: var(--color-interface-050);
2025-12-09 17:08:40 +01:00
font-family: var(--mono);
font-size: 0.75rem;
border-radius: 4px;
white-space: nowrap;
opacity: 0;
visibility: hidden;
transition:
opacity 0.15s ease,
visibility 0.15s ease;
z-index: 10;
}
&:hover::after {
opacity: 1;
visibility: visible;
}
}
2025-12-09 17:08:40 +01:00
2026-03-07 18:51:08 +01:00
// INPUT COLOR ------------------------------------------------
.input-with-color {
width: 100%;
.clr-field {
width: 100%;
display: grid;
grid-template-columns: var(--input-h) minmax(0, 1fr);
grid-gap: 1ch;
button {
grid-column: 1;
position: relative;
border-radius: var(--border-radius);
cursor: pointer;
pointer-events: auto;
}
input {
grid-column: 2;
}
}
}
// INPUT RANGE ---------------------------------------------
input[type="range"] {
-webkit-appearance: none;
appearance: none;
background: transparent;
cursor: pointer;
&::-webkit-slider-runnable-track {
height: 6px;
background: linear-gradient(to right, var(--color-interface-400) var(--progress, 0%), var(--color-interface-200) var(--progress, 0%));
border: none;
border-radius: 2px;
}
&::-moz-range-track {
height: 6px;
background: linear-gradient(to right, var(--color-interface-400) var(--progress, 0%), var(--color-interface-200) var(--progress, 0%));
border: none;
border-radius: 2px;
}
&::-moz-range-progress {
height: 6px;
background: var(--color-interface-400);
border: none;
border-radius: 2px;
}
// Thumb
&::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 14px;
height: 14px;
background: var(--color-interface-900);
border: none;
border-radius: 3px;
margin-top: -5px;
}
&::-moz-range-thumb {
width: 14px;
height: 14px;
background: var(--color-interface-900);
border: none;
border-radius: 3px;
}
}
// INPUTNUMBER ---------------------------------------------
// disable natif
2025-12-09 17:08:40 +01:00
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
appearance: none;
margin: 0;
}
input[type="number"] {
-moz-appearance: textfield;
}
.number-input {
2025-12-09 17:08:40 +01:00
position: relative;
input {
2025-12-09 17:08:40 +01:00
padding-top: 0;
padding-bottom: 0;
}
.spinner-buttons {
2025-12-09 17:08:40 +01:00
height: var(--input-h);
width: var(--input-h);
2025-12-09 17:08:40 +01:00
display: flex;
flex-direction: column;
position: absolute;
right: 0;
top: 0;
button {
height: calc(var(--input-h) * 0.5);
2025-12-09 17:08:40 +01:00
cursor: pointer;
padding: 0;
svg {
2025-12-11 13:38:27 +01:00
width: 10px;
height: auto;
}
svg path {
fill: var(--color-interface-600);
2025-12-09 17:08:40 +01:00
}
&:hover {
svg path {
2025-12-09 17:08:40 +01:00
fill: var(--color-interface-900);
}
2025-12-09 17:08:40 +01:00
}
}
.spinner-down {
svg {
2025-12-11 13:38:27 +01:00
// position: relative;
// top: -2px;
2025-12-09 17:08:40 +01:00
}
}
}
}