-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Disallow selecting the text of buttons #19330
Conversation
1387fcd
to
dca3855
Compare
Why not just button {
user-select: none;
} Reasons:
|
@@ -1526,12 +1538,12 @@ a.ui.label:hover { | |||
} | |||
|
|||
.lines-num { | |||
&:extend(.unselectable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user-select: none;
will be more readable to someone unitiated to Less. Vendor prefixes are not needed.
CanIUse gives me only 75% unprefixed. Also, there are a lot more pseudo buttons than you think there are. |
Right, Safari still needs |
Maybe compromise on |
Yeah, I can definitely throw out the unneeded prefix rules for That presents me with a problem: There might be a lot more components that might want not to be selectable.
My personal choice is the current approach because this syntax is not too obscure, and if I'm writing less and see a syntax I don't understand, I can easily google it. To give you an example:
That was my first time writing (not CSS compliant) less, I simply googled whether I can extend a styleclass in less and used the first StackOverflow result. So, it should be possible to understand even for newbies. |
Generally L-G-T-M. I prefer to keep only |
@silverwind, I would like still an answer to the question above. |
No more comment, will get this PR merged. |
* giteaofficial/main: Disallow selecting the text of buttons (go-gitea#19330)
Introduce a CSS class `.unselectable`
Currently, it is possible to select the text of buttons.
I don't see a reason why, though. A button should (by default) not allow selecting its text.
This PR changes this by adding a new style class that disallows text selection.
In the future, if you want to make something unselectable, simply give it the style class
unselectable
.If you want every element of another CSS selector to be unselectable, simply use
&:extend(.unselectable);
inside the selector body.Originated in #19007 but is thematically irrelevant.
This could even be backported as it is a non-breaking change that enhances UX.