Skip to content

Conversation

juanmitriatti
Copy link
Contributor

added mixin to expand clickable area for btn

UDS-1970

Description

Checklist

  • Tests pass for relevant code changes

Important Reminders

Links

@juanmitriatti juanmitriatti requested a review from a team as a code owner July 16, 2025 17:20
@asu-jenkins-devops
Copy link
Collaborator

position: absolute;
min-width: $min-width;
min-height: $min-height;
z-index: -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are using ::before, the text will naturally have a higher z-index, since it comes after ::before and we should not use z-index:-1 since this will push the ::before content behind an element with position: relative and will prevent the clickable-area from working

inset: 0;
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

&::before {
content: "";
position: absolute;
min-width: $min-width;
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting min-width only increases the clickable area in one direction

Image

@juanmitriatti
Copy link
Contributor Author

Hi @scott-williams-az @davidornelas11
This is ready for review again.
Thanks in advance.

Copy link
Contributor

@davidornelas11 davidornelas11 left a comment

Choose a reason for hiding this comment

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

Looks good and expands the click area

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants