Skip to content

autosize class does weird things when button wraps to next line #416

Description

@balmas

Reported by @rgorman. See attached.

mov.zip

This seems likely to be a browser bug related to the :active pseudoclass. When you click on the button, the padding drops and the button pops back to the previous line. Removing the autosize class eliminates the problem, but it also sizes the button wrong. The CSS rules retain padding on the :active class, so it's not clear what else we could do to fix this.

button, .btn, .btn:hover, .btn:visited, .btn:focus, .btn:link {
        @extend .font-button;
        height: $BUTTON_HEIGHT;
        line-height: $BUTTON_HEIGHT;
        /* Basic button has white background*/
        background-color:$COLOR_FOREGROUND;
        color: $COLOR_PRI;
        border:none;
        width: $BUTTON_WIDTH;
        text-align: center;
        border:1px solid $COLOR_FOREGROUND;
        padding:0;
        margin:$MARGIN;
        display:inline-block;
        cursor:pointer;

        &.autosize {
                width:auto;
                padding:0 ($BUTTON_HEIGHT/2);
                &:active {
                        border:1px solid $COLOR_FOREGROUND;
                        padding:0 ($BUTTON_HEIGHT/2);
                }
        }
       &:active, &.active {
                border:1px solid $COLOR_GRAY;
                border-right:$OUTLINE_SIZE solid $COLOR_PRI;
                padding:0;
        }


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions