scss: put buttons icons code inside @mixin (#74954)
gitea/publik-base-theme/pipeline/head This commit looks good Details

This commit is contained in:
Thomas Jund 2023-03-30 17:57:54 +02:00 committed by Serghei Mihai
parent 62ce7535c8
commit 450708981b
1 changed files with 29 additions and 23 deletions

View File

@ -656,34 +656,40 @@ div.select2-search {
} }
} }
// Buttons with icons // Button with FontAwesome icon
// $position: left || right
.submit-button-with-icon { // $character : UTF value
&::after { @mixin button-with-icon($position: right, $character: '\f105') {
&::before, &::after {
font-family: FontAwesome; font-family: FontAwesome;
content: $submit-button-icon; }
margin-left: 0.5em; @if ($position == left) {
&::before {
content: $character;
margin-right: 0.5em;
}
}
@if ($position == right) {
&::after {
content: $character;
margin-left: 0.5em;
}
} }
} }
.previous-button-with-icon {
&::before {
font-family: FontAwesome;
content: $previous-button-icon;
margin-right: 0.5em;
}
}
.cancel-button-with-icon {
&::before {
font-family: FontAwesome;
content: $cancel-button-icon;
margin-right: 0.5em;
}
}
@if $buttons-with-icons { @if $buttons-with-icons {
.submit-button-with-icon {
@include button-with-icon(right, $submit-button-icon);
}
.previous-button-with-icon {
@include button-with-icon(left, $previous-button-icon);
}
.cancel-button-with-icon {
@include button-with-icon(left, $cancel-button-icon);
}
.quixote:not(#wf-actions) div.buttons { .quixote:not(#wf-actions) div.buttons {
@each $btn in (submit, previous, cancel) { @each $btn in (submit, previous, cancel) {
.#{$btn}-button button { .#{$btn}-button button {