Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move hand cursor for buttons to reboot #27021

Merged
merged 3 commits into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 0 additions & 5 deletions scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
@include box-shadow(none);
}

// Opinionated: add "hand" cursor to non-disabled .btn elements
&:not(:disabled):not(.disabled) {
cursor: pointer;
}

&:not(:disabled):not(.disabled):active,
&:not(:disabled):not(.disabled).active {
@include box-shadow($btn-active-box-shadow);
Expand Down
3 changes: 0 additions & 3 deletions scss/_close.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
@include hover-focus {
opacity: .75;
}

// Opinionated: add "hand" cursor to non-disabled .close elements
cursor: pointer;
}
}

Expand Down
5 changes: 0 additions & 5 deletions scss/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@
@include hover-focus {
text-decoration: none;
}

// Opinionated: add "hand" cursor to non-disabled .navbar-toggler elements
&:not(:disabled):not(.disabled) {
cursor: pointer;
}
}

// Keep as a separate element so folks can easily override it with another icon
Expand Down
5 changes: 0 additions & 5 deletions scss/_pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
outline: $pagination-focus-outline;
box-shadow: $pagination-focus-box-shadow;
}

// Opinionated: add "hand" cursor to non-disabled .page-link elements
&:not(:disabled):not(.disabled) {
cursor: pointer;
}
}

.page-item {
Expand Down
12 changes: 12 additions & 0 deletions scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,18 @@ button,
-webkit-appearance: button; // 2
}

// Opinionated: add "hand" cursor to non-disabled button elements.
@if $enable-pointer-cursor-for-buttons {
button,
[type="button"],
[type="reset"],
[type="submit"] {
&:not(:disabled) {
cursor: pointer;
}
}
}

// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
Expand Down
1 change: 1 addition & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ $enable-transitions: true !default;
$enable-prefers-reduced-motion-media-query: true !default;
$enable-hover-media-query: false !default; // Deprecated, no longer affects any compiled CSS
$enable-grid-classes: true !default;
$enable-pointer-cursor-for-buttons: true !default;
$enable-print-styles: true !default;
$enable-validation-icons: true !default;

Expand Down
1 change: 0 additions & 1 deletion site/docs/4.2/assets/scss/_clipboard-js.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
padding: .25rem .5rem;
font-size: 75%;
color: #818a91;
cursor: pointer;
background-color: transparent;
border: 0;
@include border-radius;
Expand Down
3 changes: 3 additions & 0 deletions site/docs/4.2/content/reboot.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Various form elements have been rebooted for simpler base styles. Here are some
- `<label>`s are set to `display: inline-block` to allow `margin` to be applied.
- `<input>`s, `<select>`s, `<textarea>`s, and `<button>`s are mostly addressed by Normalize, but Reboot removes their `margin` and sets `line-height: inherit`, too.
- `<textarea>`s are modified to only be resizable vertically as horizontal resizing often "breaks" page layout.
- `<button>`s and `<input>` button elements have `cursor: pointer` when `:not(:disabled)`.

These changes, and more, are demonstrated below.

Expand Down Expand Up @@ -280,12 +281,14 @@ These changes, and more, are demonstrated below.
<p>
<button type="submit">Button submit</button>
<input type="submit" value="Input submit button">
<input type="reset" value="Input reset button">
<input type="button" value="Input button">
</p>

<p>
<button type="submit" disabled>Button submit</button>
<input type="submit" value="Input submit button" disabled>
<input type="reset" value="Input reset button" disabled>
<input type="button" value="Input button" disabled>
</p>
</fieldset>
Expand Down
27 changes: 14 additions & 13 deletions site/docs/4.2/getting-started/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,20 @@ Customize Bootstrap 4 with our built-in custom variables file and easily toggle

You can find and customize these variables for key global options in Bootstrap's `scss/_variables.scss` file.

| Variable | Values | Description |
| --------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------- |
| `$spacer` | `1rem` (default), or any value > 0 | Specifies the default spacer value to programmatically generate our [spacer utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/). |
| `$enable-rounded` | `true` (default) or `false` | Enables predefined `border-radius` styles on various components. |
| `$enable-shadows` | `true` or `false` (default) | Enables predefined `box-shadow` styles on various components. |
| `$enable-gradients` | `true` or `false` (default) | Enables predefined gradients via `background-image` styles on various components. |
| `$enable-transitions` | `true` (default) or `false` | Enables predefined `transition`s on various components. |
| `$enable-prefers-reduced-motion-media-query` | `true` (default) or `false` | Enables the [`prefers-reduced-motion` media query]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/accessibility/#reduced-motion), which suppresses certain animations/transitions based on the users' browser/operating system preferences. |
| `$enable-hover-media-query` | `true` or `false` (default) | **Deprecated** |
| `$enable-grid-classes` | `true` (default) or `false` | Enables the generation of CSS classes for the grid system (e.g., `.container`, `.row`, `.col-md-1`, etc.). |
| `$enable-caret` | `true` (default) or `false` | Enables pseudo element caret on `.dropdown-toggle`. |
| `$enable-print-styles` | `true` (default) or `false` | Enables styles for optimizing printing. |
| `$enable-validation-icons` | `true` (default) or `false` | Enables `background-image` icons within textual inputs and some custom forms for validation states. |
| Variable | Values | Description |
| -------------------------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------- |
| `$spacer` | `1rem` (default), or any value > 0 | Specifies the default spacer value to programmatically generate our [spacer utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/). |
| `$enable-rounded` | `true` (default) or `false` | Enables predefined `border-radius` styles on various components. |
| `$enable-shadows` | `true` or `false` (default) | Enables predefined `box-shadow` styles on various components. |
| `$enable-gradients` | `true` or `false` (default) | Enables predefined gradients via `background-image` styles on various components. |
| `$enable-transitions` | `true` (default) or `false` | Enables predefined `transition`s on various components. |
| `$enable-prefers-reduced-motion-media-query` | `true` (default) or `false` | Enables the [`prefers-reduced-motion` media query]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/accessibility/#reduced-motion), which suppresses certain animations/transitions based on the users' browser/operating system preferences. |
| `$enable-hover-media-query` | `true` or `false` (default) | **Deprecated** |
| `$enable-grid-classes` | `true` (default) or `false` | Enables the generation of CSS classes for the grid system (e.g., `.container`, `.row`, `.col-md-1`, etc.). |
| `$enable-caret` | `true` (default) or `false` | Enables pseudo element caret on `.dropdown-toggle`. |
| `$enable-pointer-cursor-for-buttons` | `true` (default) or `false` | Add "hand" cursor to non-disabled button elements. |
| `$enable-print-styles` | `true` (default) or `false` | Enables styles for optimizing printing. |
| `$enable-validation-icons` | `true` (default) or `false` | Enables `background-image` icons within textual inputs and some custom forms for validation states. |

## Color

Expand Down