Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/unity-bootstrap-theme/src/scss/extends/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@
1rem;
}

@mixin clickable-area() {
position: relative;
&::before {
content: "";
position: absolute;
inset: -10px;
margin: auto;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image
  &::before {
    content: "";
    position: absolute;
    min-width: $min-width; // is not needed, but doesn't hurt
    min-height: $min-height;
    // z-index: -1;
    inset: 0;
    margin: auto;
    right: min(0px, calc(50% - #{$min-width} / 2));
    left: min(0px, calc(50% - #{$min-width} / 2));


    background-color: #f002; // visual testing only
  }

The code above equally expands the clickable area in all directions, The only issue is the overlap with the 1 character buttons, but I think this is an extreme scenario


// Extra styles that don't have bootstrap variables to override
.btn {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I the solution needs to be on the .btn class since buttons are responsive and regular buttons inherit a small class with a narrow viewport.

Image

text-decoration: none;
font-weight: bold;
white-space: nowrap;
width: max-content !important;
@include clickable-area();

&::first-letter {
text-transform: uppercase;
}
Expand Down