Make links easier to override #7
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/components#7
Loading…
Reference in a new issue
No description provided.
Delete branch "button--link-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I will probably end up making a few more of these as I run into them. The current setup makes it really difficult to override styling due to the high specificity of the default state.
This moves the
color
to the top level, then adds individual blocks for:hover
, and:disabled
In what situation would you need to override these? And, with what?
@NetOperatorWibby The splash screen in the app. We turn all links white because of the green background. This makes it so we just need to add a separate class
load-screen__button
and the color will work.Instead of having to do something like:
Another place we do (and is a pain) is buttons inside of forms. But I figured I would make a PR with this since it's smaller to figure out the best way forward.
I don't think that's a reason to change the component logic. Loading screens are special cases, it makes sense to have to do specific things that only apply to them, within them.
I'm not changing the logic of this though. I'm just removing un-needed specificity.
The specificity applies to buttons that are not disabled. Disabled buttons shouldn't have styling applied to them. Component styles should not be overridden.
Why not just add an extra class for button links that should be white?
I removed the
:disabled
style. I realize that is not needed withpointer-events: none
on disabled buttons.I don't see why these can't be overridden though. I want the same style rules for it, but only want to change the color. If I need to use an entirely different class instead of combining them I will end up with duplicated code.
This change makes it so I can do this:
instead of
I suppose I can just prevent the rules for
[disabled]
and.button--disabled
from being overridden.The
test:sass
script needs to be run on this PR, then it'll be good for merge and I can deploy to npm.@NetOperatorWibby Ran
test:sass
. Should be good I think.