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

297 lines
5.2 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;
2025-12-09 17:08:40 +01:00
// min-width: var(--input-w);
// width: 100%;
// padding: 0 1ch;
}
2025-12-10 11:10:14 +01:00
.field {
display: flex;
label {
font-weight: 600;
color: var(--color-800);
}
.input-with-unit {
display: flex;
gap: 0.3rem;
}
.unit-toggle {
height: var(--input-h);
display: flex;
gap: 0.3rem;
align-items: center;
}
.input-with-color {
width: 100%;
.clr-field {
width: 100%;
display: grid;
grid-template-columns: var(--input-h);
grid-gap: 1ch;
button{
grid-column: 1;
position: relative;
border-radius: var(--border-radius);
}
input{
grid-column: 2;
}
}
}
}
.field{
display: grid;
grid-template-columns: var(--label-w) 1fr;
label{
align-self: center;
}
}
.field-font{
display: grid;
grid-template-columns: var(--label-w) 1fr;
grid-template-rows: var(--input-h) var(--input-h);
select{
width: 100%;
}
.field-checkbox{
2025-12-11 13:39:23 +01:00
grid-column: 2;
2025-12-10 11:10:14 +01:00
padding-top: var(--space-xs);
label{
font-weight: 400;
margin-left: 0.75ch;
2025-12-11 13:38:27 +01:00
color: var(--color-txt);
2025-12-10 11:10:14 +01:00
}
}
}
2025-12-11 13:38:27 +01:00
.field-text-size{
input[type="number"]{
width: var(--input-w-small);
padding-left: 0.75ch;
}
input[type="range"]{
flex-grow: 2;
flex-shrink: 2;
}
}
2025-12-10 11:10:14 +01:00
.field-margin, .field-size{
display: inline-grid;
width: calc(50% - 1ch);
grid-template-columns: 6.5ch var(--input-w-small) 1fr;
margin-bottom: var(--space-xs);
input{
width: var(--input-w-small);
padding-left: 0.75ch;
}
&:nth-of-type(odd){
margin-right: 2ch;
}
}
.checkbox-field{
margin: calc(var(--space-xs)*2) 0;
grid-template-columns: 3ch 1fr;
input{
justify-self: left;
margin: 0;
}
}
2025-12-09 14:05:53 +01:00
.field--view-only {
opacity: 0.3;
}
/* Label with CSS 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
// INPUTNUMBER ===============================================
// Masquer les spinners natifs partout
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{
position: relative;
// padding: 0 1ch!important;
input{
padding-top: 0;
padding-bottom: 0;
}
.spinner-buttons{
height: var(--input-h);
width: var(--input-h);
display: flex;
flex-direction: column;
position: absolute;
right: 0;
top: 0;
button{
2025-12-11 13:38:27 +01:00
height: calc(var(--input-h)*0.5);
2025-12-09 17:08:40 +01:00
cursor: pointer;
padding: 0;
2025-12-11 13:38:27 +01:00
svg{
width: 10px;
height: auto;
}
2025-12-09 17:08:40 +01:00
svg path{
fill: var(--color-interface-600);
}
&:hover{
svg path{
fill: var(--color-interface-900);
}
}
}
.spinner-down{
svg{
2025-12-11 13:38:27 +01:00
// position: relative;
// top: -2px;
2025-12-09 17:08:40 +01:00
}
}
}
2025-12-09 17:08:40 +01:00
}
2025-12-09 17:08:40 +01:00
// Composant NumberInput avec boutons personnalisés
// .number-input {
// position: relative;
// display: flex;
// align-items: center;
// width: 100%;
// position: relative;
// input[type="number"] {
// width: 100%;
// box-sizing: border-box;
// }
// .spinner-buttons {
// background-color: red;
// position: absolute;
// right: 1px;
// top: 1px;
// bottom: 1px;
// display: flex;
// flex-direction: column;
// justify-content: center;
// gap: 1px;
// z-index: 10;
// .spinner-btn {
// display: flex;
// align-items: center;
// justify-content: center;
// width: 20px;
// height: 10px;
// padding: 0;
// margin: 0;
// background-color: var(--color-interface-200);
// border: 1px solid var(--color-interface-300);
// border-radius: 2px;
// cursor: pointer;
// transition: background-color 0.15s ease;
// color: var(--color-interface-700);
// line-height: 0;
// svg {
// width: 8px;
// height: 6px;
// display: block;
// }
// &:hover:not(:disabled) {
// background-color: var(--color-interface-300);
// color: var(--color-interface-900);
// }
// &:active:not(:disabled) {
// background-color: var(--color-interface-400);
// }
// &:disabled {
// opacity: 0.3;
// cursor: not-allowed;
// }
// }
// }
// }