Skip to content

Commit ed3a4f3

Browse files
authored
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 <[email protected]>
1 parent bdd9ae0 commit ed3a4f3

File tree

3 files changed

+98
-120
lines changed

3 files changed

+98
-120
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Added types for `resolveConfig` ([#8924](https://github.com/tailwindlabs/tailwindcss/pull/8924))
1313

14+
### Changed
15+
16+
- Don't use `cursor: pointer` for buttons by default ([#8962](https://github.com/tailwindlabs/tailwindcss/pull/8962))
17+
1418
## [3.1.6] - 2022-07-11
1519

1620
### Fixed

src/css/preflight.css

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -315,22 +315,6 @@ textarea::placeholder {
315315
color: theme('colors.gray.400', #9ca3af); /* 2 */
316316
}
317317

318-
/*
319-
Set the default cursor for buttons.
320-
*/
321-
322-
button,
323-
[role="button"] {
324-
cursor: pointer;
325-
}
326-
327-
/*
328-
Make sure disabled buttons don't get the pointer cursor.
329-
*/
330-
:disabled {
331-
cursor: default;
332-
}
333-
334318
/*
335319
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
336320
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)

tests/__snapshots__/source-maps.test.js.snap

Lines changed: 94 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -242,118 +242,108 @@ Array [
242242
"2:4-18 -> 317:2-24",
243243
"2:18 -> 318:0",
244244
"2:4 -> 320:0",
245-
"2:18 -> 322:1",
246-
"2:4 -> 324:0",
247-
"2:4-18 -> 326:2-17",
248-
"2:18 -> 327:0",
249-
"2:4 -> 329:0",
250-
"2:18 -> 331:1",
251-
"2:4 -> 332:0",
252-
"2:4-18 -> 333:2-17",
253-
"2:18 -> 334:0",
254-
"2:4 -> 336:0",
245+
"2:18 -> 324:1",
246+
"2:4 -> 326:0",
247+
"2:4-18 -> 334:2-24",
248+
"2:4-18 -> 335:2-32",
249+
"2:18 -> 336:0",
250+
"2:4 -> 338:0",
255251
"2:18 -> 340:1",
256252
"2:4 -> 342:0",
257-
"2:4-18 -> 350:2-24",
258-
"2:4-18 -> 351:2-32",
259-
"2:18 -> 352:0",
260-
"2:4 -> 354:0",
261-
"2:18 -> 356:1",
262-
"2:4 -> 358:0",
263-
"2:4-18 -> 360:2-17",
264-
"2:4-18 -> 361:2-14",
265-
"2:18 -> 362:0",
266-
"2:4 -> 364:0",
267-
"2:4-18 -> 365:2-26",
253+
"2:4-18 -> 344:2-17",
254+
"2:4-18 -> 345:2-14",
255+
"2:18 -> 346:0",
256+
"2:4 -> 348:0",
257+
"2:4-18 -> 349:2-26",
258+
"2:4-18 -> 350:2-26",
259+
"2:4-18 -> 351:2-21",
260+
"2:4-18 -> 352:2-21",
261+
"2:4-18 -> 353:2-16",
262+
"2:4-18 -> 354:2-16",
263+
"2:4-18 -> 355:2-16",
264+
"2:4-18 -> 356:2-17",
265+
"2:4-18 -> 357:2-17",
266+
"2:4-18 -> 358:2-15",
267+
"2:4-18 -> 359:2-15",
268+
"2:4-18 -> 360:2-20",
269+
"2:4-18 -> 361:2-40",
270+
"2:4-18 -> 362:2-17",
271+
"2:4-18 -> 363:2-22",
272+
"2:4-18 -> 364:2-24",
273+
"2:4-18 -> 365:2-25",
268274
"2:4-18 -> 366:2-26",
269-
"2:4-18 -> 367:2-21",
270-
"2:4-18 -> 368:2-21",
271-
"2:4-18 -> 369:2-16",
272-
"2:4-18 -> 370:2-16",
273-
"2:4-18 -> 371:2-16",
274-
"2:4-18 -> 372:2-17",
275-
"2:4-18 -> 373:2-17",
276-
"2:4-18 -> 374:2-15",
277-
"2:4-18 -> 375:2-15",
275+
"2:4-18 -> 367:2-20",
276+
"2:4-18 -> 368:2-29",
277+
"2:4-18 -> 369:2-30",
278+
"2:4-18 -> 370:2-40",
279+
"2:4-18 -> 371:2-36",
280+
"2:4-18 -> 372:2-29",
281+
"2:4-18 -> 373:2-24",
282+
"2:4-18 -> 374:2-32",
283+
"2:4-18 -> 375:2-14",
278284
"2:4-18 -> 376:2-20",
279-
"2:4-18 -> 377:2-40",
280-
"2:4-18 -> 378:2-17",
281-
"2:4-18 -> 379:2-22",
282-
"2:4-18 -> 380:2-24",
283-
"2:4-18 -> 381:2-25",
284-
"2:4-18 -> 382:2-26",
285-
"2:4-18 -> 383:2-20",
286-
"2:4-18 -> 384:2-29",
287-
"2:4-18 -> 385:2-30",
288-
"2:4-18 -> 386:2-40",
289-
"2:4-18 -> 387:2-36",
285+
"2:4-18 -> 377:2-18",
286+
"2:4-18 -> 378:2-19",
287+
"2:4-18 -> 379:2-20",
288+
"2:4-18 -> 380:2-16",
289+
"2:4-18 -> 381:2-18",
290+
"2:4-18 -> 382:2-15",
291+
"2:4-18 -> 383:2-21",
292+
"2:4-18 -> 384:2-23",
293+
"2:4-18 -> 385:2-29",
294+
"2:4-18 -> 386:2-27",
295+
"2:4-18 -> 387:2-28",
290296
"2:4-18 -> 388:2-29",
291-
"2:4-18 -> 389:2-24",
292-
"2:4-18 -> 390:2-32",
293-
"2:4-18 -> 391:2-14",
294-
"2:4-18 -> 392:2-20",
295-
"2:4-18 -> 393:2-18",
296-
"2:4-18 -> 394:2-19",
297-
"2:4-18 -> 395:2-20",
298-
"2:4-18 -> 396:2-16",
299-
"2:4-18 -> 397:2-18",
300-
"2:4-18 -> 398:2-15",
297+
"2:4-18 -> 389:2-25",
298+
"2:4-18 -> 390:2-26",
299+
"2:4-18 -> 391:2-27",
300+
"2:4 -> 392:2",
301+
"2:18 -> 393:0",
302+
"2:4 -> 395:0",
303+
"2:4-18 -> 396:2-26",
304+
"2:4-18 -> 397:2-26",
305+
"2:4-18 -> 398:2-21",
301306
"2:4-18 -> 399:2-21",
302-
"2:4-18 -> 400:2-23",
303-
"2:4-18 -> 401:2-29",
304-
"2:4-18 -> 402:2-27",
305-
"2:4-18 -> 403:2-28",
306-
"2:4-18 -> 404:2-29",
307-
"2:4-18 -> 405:2-25",
308-
"2:4-18 -> 406:2-26",
309-
"2:4-18 -> 407:2-27",
310-
"2:4 -> 408:2",
311-
"2:18 -> 409:0",
312-
"2:4 -> 411:0",
313-
"2:4-18 -> 412:2-26",
307+
"2:4-18 -> 400:2-16",
308+
"2:4-18 -> 401:2-16",
309+
"2:4-18 -> 402:2-16",
310+
"2:4-18 -> 403:2-17",
311+
"2:4-18 -> 404:2-17",
312+
"2:4-18 -> 405:2-15",
313+
"2:4-18 -> 406:2-15",
314+
"2:4-18 -> 407:2-20",
315+
"2:4-18 -> 408:2-40",
316+
"2:4-18 -> 409:2-17",
317+
"2:4-18 -> 410:2-22",
318+
"2:4-18 -> 411:2-24",
319+
"2:4-18 -> 412:2-25",
314320
"2:4-18 -> 413:2-26",
315-
"2:4-18 -> 414:2-21",
316-
"2:4-18 -> 415:2-21",
317-
"2:4-18 -> 416:2-16",
318-
"2:4-18 -> 417:2-16",
319-
"2:4-18 -> 418:2-16",
320-
"2:4-18 -> 419:2-17",
321-
"2:4-18 -> 420:2-17",
322-
"2:4-18 -> 421:2-15",
323-
"2:4-18 -> 422:2-15",
321+
"2:4-18 -> 414:2-20",
322+
"2:4-18 -> 415:2-29",
323+
"2:4-18 -> 416:2-30",
324+
"2:4-18 -> 417:2-40",
325+
"2:4-18 -> 418:2-36",
326+
"2:4-18 -> 419:2-29",
327+
"2:4-18 -> 420:2-24",
328+
"2:4-18 -> 421:2-32",
329+
"2:4-18 -> 422:2-14",
324330
"2:4-18 -> 423:2-20",
325-
"2:4-18 -> 424:2-40",
326-
"2:4-18 -> 425:2-17",
327-
"2:4-18 -> 426:2-22",
328-
"2:4-18 -> 427:2-24",
329-
"2:4-18 -> 428:2-25",
330-
"2:4-18 -> 429:2-26",
331-
"2:4-18 -> 430:2-20",
332-
"2:4-18 -> 431:2-29",
333-
"2:4-18 -> 432:2-30",
334-
"2:4-18 -> 433:2-40",
335-
"2:4-18 -> 434:2-36",
331+
"2:4-18 -> 424:2-18",
332+
"2:4-18 -> 425:2-19",
333+
"2:4-18 -> 426:2-20",
334+
"2:4-18 -> 427:2-16",
335+
"2:4-18 -> 428:2-18",
336+
"2:4-18 -> 429:2-15",
337+
"2:4-18 -> 430:2-21",
338+
"2:4-18 -> 431:2-23",
339+
"2:4-18 -> 432:2-29",
340+
"2:4-18 -> 433:2-27",
341+
"2:4-18 -> 434:2-28",
336342
"2:4-18 -> 435:2-29",
337-
"2:4-18 -> 436:2-24",
338-
"2:4-18 -> 437:2-32",
339-
"2:4-18 -> 438:2-14",
340-
"2:4-18 -> 439:2-20",
341-
"2:4-18 -> 440:2-18",
342-
"2:4-18 -> 441:2-19",
343-
"2:4-18 -> 442:2-20",
344-
"2:4-18 -> 443:2-16",
345-
"2:4-18 -> 444:2-18",
346-
"2:4-18 -> 445:2-15",
347-
"2:4-18 -> 446:2-21",
348-
"2:4-18 -> 447:2-23",
349-
"2:4-18 -> 448:2-29",
350-
"2:4-18 -> 449:2-27",
351-
"2:4-18 -> 450:2-28",
352-
"2:4-18 -> 451:2-29",
353-
"2:4-18 -> 452:2-25",
354-
"2:4-18 -> 453:2-26",
355-
"2:4-18 -> 454:2-27",
356-
"2:4 -> 455:2",
357-
"2:18 -> 456:0",
343+
"2:4-18 -> 436:2-25",
344+
"2:4-18 -> 437:2-26",
345+
"2:4-18 -> 438:2-27",
346+
"2:4 -> 439:2",
347+
"2:18 -> 440:0",
358348
]
359349
`;

0 commit comments

Comments
 (0)