From ed3a4f3032b486d8d328089011def785d6572462 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Tue, 26 Jul 2022 20:55:09 -0400 Subject: [PATCH] Don't use `cursor: pointer` for buttons by default (#8962) * Don't use `cursor: pointer` for buttons by default This is a pretty common expectation but as outlined in in #8961 isn't really right. We considered this a long time ago but it felt too against the grain at the time. These days though very UI-forward applications like [Linear](https://linear.app/) are using the default cursor for buttons and I think this trend will continue as more people become aware that `cursor: pointer` is meant for links. Let's update our defaults here to help nudge people in this direction and make it more common. If people want to change this in their own apps, it's just a line or two of CSS to add to their projects. * Update changelog Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com> --- CHANGELOG.md | 4 + src/css/preflight.css | 16 -- tests/__snapshots__/source-maps.test.js.snap | 198 +++++++++---------- 3 files changed, 98 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11d8dfb0e785..a894856d1598 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added types for `resolveConfig` ([#8924](https://github.com/tailwindlabs/tailwindcss/pull/8924)) +### Changed + +- Don't use `cursor: pointer` for buttons by default ([#8962](https://github.com/tailwindlabs/tailwindcss/pull/8962)) + ## [3.1.6] - 2022-07-11 ### Fixed diff --git a/src/css/preflight.css b/src/css/preflight.css index bf36495d2371..a8e490a24d46 100644 --- a/src/css/preflight.css +++ b/src/css/preflight.css @@ -315,22 +315,6 @@ textarea::placeholder { color: theme('colors.gray.400', #9ca3af); /* 2 */ } -/* -Set the default cursor for buttons. -*/ - -button, -[role="button"] { - cursor: pointer; -} - -/* -Make sure disabled buttons don't get the pointer cursor. -*/ -:disabled { - cursor: default; -} - /* 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) diff --git a/tests/__snapshots__/source-maps.test.js.snap b/tests/__snapshots__/source-maps.test.js.snap index e7aca966cd7e..18a93a82bf1e 100644 --- a/tests/__snapshots__/source-maps.test.js.snap +++ b/tests/__snapshots__/source-maps.test.js.snap @@ -242,118 +242,108 @@ Array [ "2:4-18 -> 317:2-24", "2:18 -> 318:0", "2:4 -> 320:0", - "2:18 -> 322:1", - "2:4 -> 324:0", - "2:4-18 -> 326:2-17", - "2:18 -> 327:0", - "2:4 -> 329:0", - "2:18 -> 331:1", - "2:4 -> 332:0", - "2:4-18 -> 333:2-17", - "2:18 -> 334:0", - "2:4 -> 336:0", + "2:18 -> 324:1", + "2:4 -> 326:0", + "2:4-18 -> 334:2-24", + "2:4-18 -> 335:2-32", + "2:18 -> 336:0", + "2:4 -> 338:0", "2:18 -> 340:1", "2:4 -> 342:0", - "2:4-18 -> 350:2-24", - "2:4-18 -> 351:2-32", - "2:18 -> 352:0", - "2:4 -> 354:0", - "2:18 -> 356:1", - "2:4 -> 358:0", - "2:4-18 -> 360:2-17", - "2:4-18 -> 361:2-14", - "2:18 -> 362:0", - "2:4 -> 364:0", - "2:4-18 -> 365:2-26", + "2:4-18 -> 344:2-17", + "2:4-18 -> 345:2-14", + "2:18 -> 346:0", + "2:4 -> 348:0", + "2:4-18 -> 349:2-26", + "2:4-18 -> 350:2-26", + "2:4-18 -> 351:2-21", + "2:4-18 -> 352:2-21", + "2:4-18 -> 353:2-16", + "2:4-18 -> 354:2-16", + "2:4-18 -> 355:2-16", + "2:4-18 -> 356:2-17", + "2:4-18 -> 357:2-17", + "2:4-18 -> 358:2-15", + "2:4-18 -> 359:2-15", + "2:4-18 -> 360:2-20", + "2:4-18 -> 361:2-40", + "2:4-18 -> 362:2-17", + "2:4-18 -> 363:2-22", + "2:4-18 -> 364:2-24", + "2:4-18 -> 365:2-25", "2:4-18 -> 366:2-26", - "2:4-18 -> 367:2-21", - "2:4-18 -> 368:2-21", - "2:4-18 -> 369:2-16", - "2:4-18 -> 370:2-16", - "2:4-18 -> 371:2-16", - "2:4-18 -> 372:2-17", - "2:4-18 -> 373:2-17", - "2:4-18 -> 374:2-15", - "2:4-18 -> 375:2-15", + "2:4-18 -> 367:2-20", + "2:4-18 -> 368:2-29", + "2:4-18 -> 369:2-30", + "2:4-18 -> 370:2-40", + "2:4-18 -> 371:2-36", + "2:4-18 -> 372:2-29", + "2:4-18 -> 373:2-24", + "2:4-18 -> 374:2-32", + "2:4-18 -> 375:2-14", "2:4-18 -> 376:2-20", - "2:4-18 -> 377:2-40", - "2:4-18 -> 378:2-17", - "2:4-18 -> 379:2-22", - "2:4-18 -> 380:2-24", - "2:4-18 -> 381:2-25", - "2:4-18 -> 382:2-26", - "2:4-18 -> 383:2-20", - "2:4-18 -> 384:2-29", - "2:4-18 -> 385:2-30", - "2:4-18 -> 386:2-40", - "2:4-18 -> 387:2-36", + "2:4-18 -> 377:2-18", + "2:4-18 -> 378:2-19", + "2:4-18 -> 379:2-20", + "2:4-18 -> 380:2-16", + "2:4-18 -> 381:2-18", + "2:4-18 -> 382:2-15", + "2:4-18 -> 383:2-21", + "2:4-18 -> 384:2-23", + "2:4-18 -> 385:2-29", + "2:4-18 -> 386:2-27", + "2:4-18 -> 387:2-28", "2:4-18 -> 388:2-29", - "2:4-18 -> 389:2-24", - "2:4-18 -> 390:2-32", - "2:4-18 -> 391:2-14", - "2:4-18 -> 392:2-20", - "2:4-18 -> 393:2-18", - "2:4-18 -> 394:2-19", - "2:4-18 -> 395:2-20", - "2:4-18 -> 396:2-16", - "2:4-18 -> 397:2-18", - "2:4-18 -> 398:2-15", + "2:4-18 -> 389:2-25", + "2:4-18 -> 390:2-26", + "2:4-18 -> 391:2-27", + "2:4 -> 392:2", + "2:18 -> 393:0", + "2:4 -> 395:0", + "2:4-18 -> 396:2-26", + "2:4-18 -> 397:2-26", + "2:4-18 -> 398:2-21", "2:4-18 -> 399:2-21", - "2:4-18 -> 400:2-23", - "2:4-18 -> 401:2-29", - "2:4-18 -> 402:2-27", - "2:4-18 -> 403:2-28", - "2:4-18 -> 404:2-29", - "2:4-18 -> 405:2-25", - "2:4-18 -> 406:2-26", - "2:4-18 -> 407:2-27", - "2:4 -> 408:2", - "2:18 -> 409:0", - "2:4 -> 411:0", - "2:4-18 -> 412:2-26", + "2:4-18 -> 400:2-16", + "2:4-18 -> 401:2-16", + "2:4-18 -> 402:2-16", + "2:4-18 -> 403:2-17", + "2:4-18 -> 404:2-17", + "2:4-18 -> 405:2-15", + "2:4-18 -> 406:2-15", + "2:4-18 -> 407:2-20", + "2:4-18 -> 408:2-40", + "2:4-18 -> 409:2-17", + "2:4-18 -> 410:2-22", + "2:4-18 -> 411:2-24", + "2:4-18 -> 412:2-25", "2:4-18 -> 413:2-26", - "2:4-18 -> 414:2-21", - "2:4-18 -> 415:2-21", - "2:4-18 -> 416:2-16", - "2:4-18 -> 417:2-16", - "2:4-18 -> 418:2-16", - "2:4-18 -> 419:2-17", - "2:4-18 -> 420:2-17", - "2:4-18 -> 421:2-15", - "2:4-18 -> 422:2-15", + "2:4-18 -> 414:2-20", + "2:4-18 -> 415:2-29", + "2:4-18 -> 416:2-30", + "2:4-18 -> 417:2-40", + "2:4-18 -> 418:2-36", + "2:4-18 -> 419:2-29", + "2:4-18 -> 420:2-24", + "2:4-18 -> 421:2-32", + "2:4-18 -> 422:2-14", "2:4-18 -> 423:2-20", - "2:4-18 -> 424:2-40", - "2:4-18 -> 425:2-17", - "2:4-18 -> 426:2-22", - "2:4-18 -> 427:2-24", - "2:4-18 -> 428:2-25", - "2:4-18 -> 429:2-26", - "2:4-18 -> 430:2-20", - "2:4-18 -> 431:2-29", - "2:4-18 -> 432:2-30", - "2:4-18 -> 433:2-40", - "2:4-18 -> 434:2-36", + "2:4-18 -> 424:2-18", + "2:4-18 -> 425:2-19", + "2:4-18 -> 426:2-20", + "2:4-18 -> 427:2-16", + "2:4-18 -> 428:2-18", + "2:4-18 -> 429:2-15", + "2:4-18 -> 430:2-21", + "2:4-18 -> 431:2-23", + "2:4-18 -> 432:2-29", + "2:4-18 -> 433:2-27", + "2:4-18 -> 434:2-28", "2:4-18 -> 435:2-29", - "2:4-18 -> 436:2-24", - "2:4-18 -> 437:2-32", - "2:4-18 -> 438:2-14", - "2:4-18 -> 439:2-20", - "2:4-18 -> 440:2-18", - "2:4-18 -> 441:2-19", - "2:4-18 -> 442:2-20", - "2:4-18 -> 443:2-16", - "2:4-18 -> 444:2-18", - "2:4-18 -> 445:2-15", - "2:4-18 -> 446:2-21", - "2:4-18 -> 447:2-23", - "2:4-18 -> 448:2-29", - "2:4-18 -> 449:2-27", - "2:4-18 -> 450:2-28", - "2:4-18 -> 451:2-29", - "2:4-18 -> 452:2-25", - "2:4-18 -> 453:2-26", - "2:4-18 -> 454:2-27", - "2:4 -> 455:2", - "2:18 -> 456:0", + "2:4-18 -> 436:2-25", + "2:4-18 -> 437:2-26", + "2:4-18 -> 438:2-27", + "2:4 -> 439:2", + "2:18 -> 440:0", ] `;