darkpixlz
(darkpixlz)
July 24, 2022, 4:08am
1
Hi!
Tonight I was looking into making a PR to make the click effect on buttons optional via a setting. I think personally it looks pretty bad, but there are probably people that really like it.
This is what I mean, you can see it by clicking and holding down on most any button
It looks even worse on some buttons;
I dont think the team is looking to remove it completely, so I was going to look into making a site setting, then accessing it via the button scss .
I dont think there’s an easy file to just make a setting and give it a property. Is there? If not, how do I do it and then get it in the SCSS file?
Thanks for any help!
Falco
(Falco)
July 24, 2022, 4:17am
2
Isn’t this something that can be overwritten via a theme-component?
3 Likes
darkpixlz
(darkpixlz)
July 24, 2022, 4:19am
3
I guess I forgot about components for this issue in specific lol
But for the future is it possible to create settings? I will fix the issue on my end in a bit
EDIT: Just tried fixing it on my end and it didn’t work.
Don
July 24, 2022, 8:47am
4
Hello,
If I understand it correctly this is the button’s :active
status what you want to change.
There is a linear-grandient
mixin to color transition.
//noinspection CssOptimizeSimilarProperties
@mixin linear-gradient($start-color, $end-color) {
background-color: $start-color;
background-image: linear-gradient(to bottom, $start-color, $end-color);
}
linear-gradient
used when the button is active. As you can see in the buttons.css
This whole is the default button mixin.
@mixin btn(
$text-color: var(--primary),
$bg-color: var(--primary-low),
$icon-color: var(--primary-high),
$hover-text-color: var(--secondary),
$hover-bg-color: var(--primary-medium),
$hover-icon-color: var(--primary-low)
) {
@include form-item-sizing;
display: inline-flex;
align-items: center;
justify-content: center;
margin: 0;
font-weight: normal;
color: $text-color;
background: $bg-color;
cursor: pointer;
transition: all 0.25s;
.d-icon {
color: $icon-color;
This file has been truncated. show original
And only the colors variables changes on the other button like .btn-primary and below:
.btn-primary {
@include btn(
$text-color: var(--secondary),
$bg-color: var(--tertiary),
$icon-color: var(--secondary),
$hover-bg-color: var(--tertiary-hover),
$hover-icon-color: var(--secondary)
);
}
So you can override the linear-gradient
mixin output with target the active
classes.
Something like this should work.
We have to target the button types classes because the color variables different so we cannot target it globally.
// Default button
.btn {
&:active,
&.btn-active {
background-image: none;
border-bottom-color: transparent;
background-color: var(--primary-medium);
}
// Primary button
&.btn-primary {
&:active,
&.btn-active {
background-color: var(--tertiary-hover);
}
}
// Danger and ✘ button
&.btn-danger,
&.cancel {
&:active,
&.btn-active {
background-color: var(--danger-hover);
}
}
// ✔ button
&.ok {
&:active,
&.btn-active {
background-color: var(--success-hover);
}
}
}
Before
After
5 Likes
system
(system)
Closed
December 8, 2022, 3:40pm
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.