Fix inset link buttons not looking like buttons #878
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently if we have a button that is inset and another button that has a href and is inset, they do not look the same.
This was previously fixed in PR #35 for links, but the issue now happens for link-buttons that use the
inset
prop.The reason this happens is in the code for the button, there is this line and comment
->add($inset ? 'flex' : 'inline-flex') // inline-flex is weird with negative margins...
.The
inline-flex
was added in PR livewire/flux#35 to ensure that link-buttons looked like standard buttons. This was because buttons areinline-block
by default and links areblock
by default, soinline-flex
needed to be applied so they get treaded the same way.So for link-buttons to work with
inset
, we need to re-enable theinline-flex
for inset buttons and link-buttons.I've done some testing with buttons and link buttons both set to
flex
andinline-flex
, to see if I could work out howinline-flex
and negative margins could interact, and I couldn't see any differences.As I can't work out exactly what weird negative margin issues
inline-flex
required that line of code to be added, I think we should just remove it for now and see if we can any bug reports regarding it.So this PR removes that line.
Fixes #801