Skip to content

Conversation

barnabaskecskes
Copy link

It is somewhat cumbersome to undo cursor-pointer class and cannot be done with tailwind itself at the time of this PR. For example imagine a navigation where all li tags need to show as links but the currently active one. Consider below.

li {
    @apply .cursor-pointer;

    &.active {
        cursor: default; // no tailwind option
    }
}

Yes, one could do it with more complex selectors (see below), but it's much simpler to have the extra option available when needed (see even below - after the change).

li {
    &:not(.active) {
        @apply .cursor-pointer;
    }
}

After-PR option:

li {
    @apply .cursor-pointer;

    &.active {
        @apply .cursor-default;
    }
}

@adamwathan
Copy link
Member

Hey thanks for the PR! We have .cursor-auto which is intended to be used to reset any cursor overrides back to the browsers default for that element; does that not give the results you’re expecting? Open to merging this for sure if we need it.

@barnabaskecskes
Copy link
Author

Hey Adam, very interesting indeed... I have checked in Firefox (an older version, maybe before 2-3 updates prior to latest and latest) and in both of those it works as you expect. I tested Chrome 61 and 62 (latest) and it does not work the same - I have to specify cursor: default; explicitly to get the expected behaviour. I'm not sure whether it is a bug in Chrome or intended behaviour, but currently it works rather an inherit type than a browser default one. (For avoidance of doubt, I have done the tests with normal CSS properties as well - same results.)

@adamwathan
Copy link
Member

Hmm I can't seem to replicate that in latest Chrome. Here's a fiddle, can you fork it and show me what you're trying to do that doesn't give the expected results?

https://jsfiddle.net/egkkde0c/1/

@barnabaskecskes
Copy link
Author

Hmmm I think I know why. It only appears to be a problem if you try to use those classes on <a> tags (which probably has the browser default as cursor: pointer; so that would make sense).

See the demo at https://jsfiddle.net/28mj9595/1/.

Apparently, this behaviour got nothing to do with TailwindCSS, but for the above case, cursor-default might prove to be useful.

@adamwathan
Copy link
Member

Do you want the active link to be clickable still? If so I feel like it should have a default link cursor, and if not, I would say make it a span not an a tag if it's active so it's not actually a link.

I think we're going to hold off on adding this to the default utility set at least for now, but open to revisiting it in the future or possibly making the cursor utilities customizable.

In the mean time, it's still super easy to add your own responsive cursor-default class by adding this to your own CSS file:

@responsive {
  .cursor-default { cursor: default; }
}

Thanks for the PR still, super appreciate it and hope you'll continue to contribute in the future 👍

@barnabaskecskes
Copy link
Author

Well, making it a span instead probably makes the most sense whichever way I'm looking at it. Thanks for your time looking into this (especially as swiftly as you just did). Go, Tailwind! :)

DCzajkowski pushed a commit to DCzajkowski/tailwindcss that referenced this pull request Jul 23, 2019
Replace bg-blue-lightest with bg-blue-100
RobinMalfait pushed a commit that referenced this pull request May 10, 2025
Here is everything you need to know about this upgrade. Please take a
good look at what changed and the test results before merging this pull
request.

### What changed?




#### ✳️ dedent (1.5.3 → 1.6.0) · [Repo](https://github.com/dmnd/dedent)
· [Changelog](https://github.com/dmnd/dedent/blob/main/CHANGELOG.md)



<details>
<summary>Release Notes</summary>
<h4><a
href="https://github.com/dmnd/dedent/releases/tag/v1.6.0">1.6.0</a></h4>

<blockquote><h2 dir="auto">What's Changed</h2>
<ul dir="auto">
<li>feat: add <code class="notranslate">trimWhitespace</code> option by
<a href="https://bounce.depfu.com/github.com/43081j">@43081j</a> in <a
href="https://bounce.depfu.com/github.com/dmnd/dedent/pull/97">#97</a>
</li>
</ul>
<h2 dir="auto">New Contributors</h2>
<ul dir="auto">
<li>
<a href="https://bounce.depfu.com/github.com/43081j">@43081j</a> made
their first contribution in <a
href="https://bounce.depfu.com/github.com/dmnd/dedent/pull/97">#97</a>
</li>
</ul>
<p dir="auto"><strong>Full Changelog</strong>: <a
href="https://bounce.depfu.com/github.com/dmnd/dedent/compare/v1.5.3...v1.6.0"><tt>v1.5.3...v1.6.0</tt></a></p></blockquote>
<p><em>Does any of this look wrong? <a
href="https://depfu.com/packages/npm/dedent/feedback">Please let us
know.</a></em></p>
</details>

<details>
<summary>Commits</summary>
<p><a
href="https://github.com/dmnd/dedent/compare/90644fe0be6ed6c159efe8c905f491ba26c51c35...ab2ce25762a6ad0c26c563075f87c74427092d02">See
the full diff on Github</a>. The new version differs by 2 commits:</p>
<ul>
<li><a
href="https://github.com/dmnd/dedent/commit/ab2ce25762a6ad0c26c563075f87c74427092d02"><code>1.6.0
(#98)</code></a></li>
<li><a
href="https://github.com/dmnd/dedent/commit/86902f7c97f32e91e5a9c2c6982a73a8a4a32b67"><code>feat:
add `trimWhitespace` option (#97)</code></a></li>
</ul>
</details>












---
![Depfu
Status](https://depfu.com/badges/edd6acd35d74c8d41cbb540c30442adf/stats.svg)

[Depfu](https://depfu.com) will automatically keep this PR
conflict-free, as long as you don't add any commits to this branch
yourself. You can also trigger a rebase manually by commenting with
`@depfu rebase`.

<details><summary>All Depfu comment commands</summary>
<blockquote><dl>
<dt>@​depfu rebase</dt><dd>Rebases against your default branch and
redoes this update</dd>
<dt>@​depfu recreate</dt><dd>Recreates this PR, overwriting any edits
that you've made to it</dd>
<dt>@​depfu merge</dt><dd>Merges this PR once your tests are passing and
conflicts are resolved</dd>
<dt>@​depfu cancel merge</dt><dd>Cancels automatic merging of this
PR</dd>
<dt>@​depfu close</dt><dd>Closes this PR and deletes the branch</dd>
<dt>@​depfu reopen</dt><dd>Restores the branch and reopens this PR (if
it's closed)</dd>
<dt>@​depfu pause</dt><dd>Ignores all future updates for this dependency
and closes this PR</dd>
<dt>@​depfu pause [minor|major]</dt><dd>Ignores all future minor/major
updates for this dependency and closes this PR</dd>
<dt>@​depfu resume</dt><dd>Future versions of this dependency will
create PRs again (leaves this PR as is)</dd>
</dl></blockquote>
</details>

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants