]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Opinionated: reintroduce `cursor:pointer`
authorpatrickhlauke <redux@splintered.co.uk>
Mon, 25 Dec 2017 23:15:21 +0000 (23:15 +0000)
committerMark Otto <markd.otto@gmail.com>
Thu, 28 Dec 2017 00:28:10 +0000 (16:28 -0800)
Explicitly re-adds the "hand" `cursor:pointer` for non-disabled `.btn`, `.close`, `.navbar-toggler` elements, as well as forcing `page-link` pagination controls to always have the "hand" cursor (even if an author uses it on, say, `<button>` elements for a dynamically updating in-page pagination).

Controversial, as everybody jumped on the bandwagon following this article https://medium.com/simple-human/buttons-shouldnt-have-a-hand-cursor-b11e99ca374b - which does have its merits of course, but there are also counter-arguments like http://kizu.ru/en/issues/cursor-pointer/

And seeing the amount of issues we've seen following the change, and the potential complexity needed to consistently address the cursor issue (see https://github.com/twbs/bootstrap/issues/24156 where i explore how the cursor needs to be based on "intent", and how that's tough to determine), I'm favouring an opinionated take here of just reintroducing the `cursor:pointer`.

scss/_buttons.scss
scss/_close.scss
scss/_navbar.scss
scss/_pagination.scss

index 3184f32477609172986aa2b76ab49f616f8ba393..fa0e9c99c815f84068ceeeed87cfde60ba654b7d 100644 (file)
     @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 {
     background-image: none;
index 4271bc720b2ad985e53c2233c395bb5ea393c7ba..f1763cc224cbaf9091c27219e7f21d468e32a713 100644 (file)
     text-decoration: none;
     opacity: .75;
   }
+
+  // Opinionated: add "hand" cursor to non-disabled .close elements
+  &:not([disabled]):not(.disabled) {
+    cursor: pointer;
+  }
 }
 
 // Additional properties for button version
index 64766eb768a314384209604ac83ad18e9a2fc264..6b76649a14844b604201accff6719accdddd4bc9 100644 (file)
   @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
index 97977f46d5935d26693784b8bda7413b587a019a..286febc9d146eef7cc9854a522c23dfa8aa55bbd 100644 (file)
     background-color: $pagination-hover-bg;
     border-color: $pagination-hover-border-color;
   }
+
+
+  // Opinionated: add "hand" cursor to non-disabled .page-link elements
+  &:not([disabled]):not(.disabled) {
+    cursor: pointer;
+  }
 }
 
 .page-item {
@@ -45,6 +51,8 @@
   &.disabled .page-link {
     color: $pagination-disabled-color;
     pointer-events: none;
+    // Opinionated: remove the "hand" cursor set previously for .page-link
+    cursor: auto;
     background-color: $pagination-disabled-bg;
     border-color: $pagination-disabled-border-color;
   }