Skip to content

Commit

Permalink
Extract more props into variables, fin?
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Oct 22, 2021
1 parent 1a6662c commit bbf2cc1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
5 changes: 5 additions & 0 deletions war/src/main/less/abstracts/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@
--form-label-font-weight: bold;
--form-input-padding: 8px;
--form-input-border-radius: 6px;
--form-input-glow: 0 0 0 10px transparent;
--form-input-glow--focus: 0 0 0 5px var(--focus-input-glow);

// Animations
--standard-transition: 0.2s ease;

// Pop out menus
--menu-text-color: black;
Expand Down
40 changes: 20 additions & 20 deletions war/src/main/less/modules/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
padding: var(--form-input-padding);
border-radius: var(--form-input-border-radius);
width: 100%;
box-shadow: 0 0 0 10px transparent;
transition: 0.2s ease;
box-shadow: var(--form-input-glow);
transition: var(--standard-transition);

&:hover {
border-color: var(--input-border-hover);
Expand All @@ -63,7 +63,7 @@
&:focus {
outline: none;
border-color: var(--focus-input-border);
box-shadow: 0 0 0 5px var(--focus-input-glow);
box-shadow: var(--form-input-glow--focus);
}
}

Expand All @@ -81,8 +81,8 @@
margin: 0;
padding: 0 4px 0 29px;
line-height: 30px;
box-shadow: 0 0 0 10px transparent;
transition: 0.2s ease;
box-shadow: var(--form-input-glow);
transition: var(--standard-transition);

// Safari adds unwanted padding - let's remove it
&::-webkit-search-decoration {
Expand All @@ -102,7 +102,7 @@
&:focus {
outline: none;
border-color: var(--focus-input-border);
box-shadow: 0 0 0 5px var(--focus-input-glow);
box-shadow: var(--form-input-glow--focus);
}
}

Expand All @@ -113,7 +113,7 @@
width: 16px;
height: 16px;
fill: var(--input-border-hover);
transition: 0.2s ease;
transition: var(--standard-transition);
}

&::before {
Expand All @@ -127,7 +127,7 @@
border: 2px solid currentColor;
border-radius: 100%;
opacity: 0;
transition: 0.2s ease;
transition: var(--standard-transition);
}

&::after {
Expand All @@ -143,7 +143,7 @@
animation: loading-spinner 0.5s infinite linear;
clip-path: inset(0 0 8px 8px);
opacity: 0;
transition: 0.2s ease;
transition: var(--standard-transition);
}

&--loading {
Expand Down Expand Up @@ -217,9 +217,9 @@
border: 2px solid var(--input-border);
border-radius: 50%;
background: transparent;
box-shadow: 0 0 0 10px transparent;
box-shadow: var(--form-input-glow);

transition: 0.2s ease;
transition: var(--standard-transition);
}

&:hover::before {
Expand All @@ -231,7 +231,7 @@
&__input:focus + &__label:before, &__input:active + &__label:before {
border-width: 8px;
border-color: var(--focus-input-border);
box-shadow: 0 0 0 5px var(--focus-input-glow);
box-shadow: var(--form-input-glow--focus);
}

&__input:checked + &__label:before {
Expand All @@ -250,7 +250,7 @@
margin-top: 0;
opacity: 0;
padding-left: 32px;
transition: 0.2s ease;
transition: var(--standard-transition);
visibility: hidden;
max-height: 0;

Expand All @@ -263,7 +263,7 @@
width: 2px;
background: var(--input-border);
border-radius: 2px;
transition: 0.2s ease;
transition: var(--standard-transition);
}

&:focus-within {
Expand Down Expand Up @@ -293,11 +293,11 @@
border-radius: 10px;
cursor: pointer;
text-shadow: 0 1px 0 var(--background-color);
box-shadow: 0 0 0 10px transparent;
box-shadow: var(--form-input-glow);
text-decoration: none;
outline: none;
font-weight: 500;
transition: 0.2s ease;
transition: var(--standard-transition);
border: 2px solid var(--btn-secondary-border);

&::after {
Expand All @@ -321,7 +321,7 @@
&:active {
background: var(--btn-secondary-bg--focus);
color: var(--btn-secondary-color--focus);
box-shadow: 0 0 0 5px var(--focus-input-glow);
box-shadow: var(--form-input-glow--focus);
}

&--large {
Expand Down Expand Up @@ -378,7 +378,7 @@
background: var(--text-color);
opacity: 0.1;
border-radius: inherit;
transition: 0.2s ease;
transition: var(--standard-transition);
}

&::after {
Expand All @@ -388,10 +388,10 @@
left: 0;
bottom: 0;
right: 0;
box-shadow: 0 0 0 10px transparent;
box-shadow: var(--form-input-glow);
border-radius: inherit;
opacity: 0.1;
transition: 0.2s ease;
transition: var(--standard-transition);
}

&:hover {
Expand Down

0 comments on commit bbf2cc1

Please sign in to comment.