-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Remove and replace Frontend Libraries #179
Comments
Relevant: flarum/framework#2303 (comment) (replacing bootstrap modals with something better, or a vanilla solution). |
|
Should also strive to use vanilla JS wherever possible to make the eventual transition simpler. |
Have you considered using |
If it works, I'm all for it! |
@datitisev I think we should also include your idea of tooltips as a composable component as part of this. Do we have a separate issue for that? |
@askvortsov1 I don't think we have a separate issue; I don't remember making one & wasn't able to find one. |
I'm going to try and push for modals to use the native It's supported in Firefox and Chrome for Android, and Google even made their own polyfill which works with their desktop version of Chrome. Check out the demos to see what's possible: https://googlechrome.github.io/dialog-polyfill/ We can also use CSS-only tooltips, like these: https://kazzkiq.github.io/balloon.css/ Using JS tooltips where not needed isn't a good idea as DOM manipulation takes far more time for devices to handle and paint than just a CSS transform. It also means that we don't need to worry about "creating" the tooltips. My API suggestion for this would be something like this: <button aria-label="This will delete your forum" data-tooltip>
My cool button
</button> Using CSS's // Show tooltip only if we have both attributes
[data-tooltip][aria-label] {
&::after {
content: attr(aria-label);
}
} It's a good idea to use |
I love that CSS is powerful enough to do things like tooltips, but the problem with this solution is that it uses psuedo elements to achieve that, quoting:
|
Any issue arising from the use of pseudoelements could be resolved immediately by wrapping the node in a plain div or span. If we wanted, core could include a tooltip helper component to do this without anyone thinking about it. <Tooltip text="Hello">
<img />
</Tooltip> |
A tool tip helper component has been suggested and I think it's a great idea to promote consistency in UI and abstract away the implementation. |
Follow-up to flarum/framework#1821
Right now, we're considering:
utils/classList
=>clsx
library (we could export this out underutils/classList
like we do withutils/Stream
?) (#2760)lodash-es
with our own functions (#2827)throttle-debounce
(#2827)The text was updated successfully, but these errors were encountered: