-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Add .visible (visibility:visible) and .hidden (display:none) utility classes #19254
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
Comments
Sounds reasonable enough.
We got rid of |
Regarding the BS4 case, there are classes that make the hidden-by-default widgets visible (unless the hiding entity's sole purpose is to hide the element, or unless it'd be pointless):
Regarding non-Bootstrap widgets, it's worth considering alternate approaches which use an explicit
I note that responsive versions of such classes were rejected in #18410. Not the same as what you're suggesting, but similar enough to be worth mentioning. |
Not obvious and small .hidden alias would be just 3 short lines.
Widget uses display: none; so I don't have hidden attribute at all and can't remove it. bs4 also doesn't use HTML5 hidden attribute.
Why making new class name for each case instead of making one class name for all cases? And if you mentioned HTML5 hidden attribute why not using it instead?
Using jQuery in 2016 is problem. If you at least will start using document.querySelector() instead of And instead of writing ES6 "class" syntactic sugar use factories and Object.create(); You can find many articles and videos online explaining why it is bad practice.
Not similar at all. I agree that there is no need in making responsive classes for each breakpoint, however, at least basic helper class to set display: block; would be perfect. I would suggest making single one, let say, |
To be clear, I'm personally not opposed to adding those.
No idea. I agree that it seems like settling on a single one would be better.
FWIW, you probably don't need(/want) to toggle the classes directly; all the Bootstrap widgets have JS APIs to handle opening/closing them, which in addition to twiddling the classes also fire useful events, etc.
Partly historical reasons. The v3 code didn't use it, and using it would have required a little extra CSS that we only started including in v4 to use it properly. And generally I think there was less awareness of its existence in the past.
JS architectural advice is getting off-topic. My point was that |
It is the same as asking a question what
Even since bootstrap 3 many developers, teams and companies were using Bootstrap only as sass/less framework. Because of jQuery dependency we now have bootstrap.native, angular, react and other versions of bootstrap js API rewriten from scratch for better perfomance and compatability with JS frameworks. Obviosly in Bootstrap 4 this trend will be the same and even bigger. There will be angular bootstrap 4, react bootstrap 4 and whatever else bootstrap 4 repositories. I am using vanilla JS, ES6 and importing only modules I need, that why I can't use bootstrap official JS API. There will be also many plugins for bootstrap 4 like we had bootstrap 3 datepickers and everything else. However, it is still not too late to make native bs4 JS API so I and anyone else could do in his project using any JS framework something like import { Tab } from 'bootstrap/src/es6/tab';
big form has steps/tabs
on form validation
if invalid input in another tab
switch tab
Tab.changeTab('tab-pane-ID')
...
Tab.onChange('tab-pane-ID', function() {
...
}); Simple example about those custom APIs and widgets. I was not able to make a simple bs4 autocomplete widget without making custom styles. You are making a bootstrap 4 class based and that's very good, let then make bootstrap 4 best scss framework ever and give tools and abilities to build absolutely everything including styles used by 3rd party JS libraries and frameworks. My point what I want to say is if bootstrap won't have default options for common cases then there will be again custom APIs and many plugins with custom styles and when time comes to maitnain a big project it becomes to a real pain. Bootstrap css, bootstrap js, custom theme, jquery, jquery plugins, custom plugin A css, custom plugin A js, ... custom plugin Z css/js, micro-framework, template engine, somewhere project's own codebase, bootstrap class overrides etc. Most jr. developers are learning form frameworks and their coding styles, standrads and software design patterns. More options you give, better the whole Internet and easier life for developers you make. P.S. even if my time is very limited, I am always happy to contribute. If you need help somewhere you can always mention me with @ in comment, even if just opinion required. Btw, I would recommend making a slack room for project where anyone could discuss features, internal development and ask any questions. |
I'm all for |
See 3rd bullet point of https://github.com/twbs/bootstrap#community
Having followed this issue tracker for quite a while, I'm not so optimistic / don't share your level of faith in humanity at this point. |
Split the |
Opened a new issue regarding the suggestion to use 1 uniform class name for opened/expanded/shown widgets: #19344 |
Also, now that I look, I see we specifically killed |
CC: @mdo for opinion regarding the remaining |
@mdo Need you to weigh in here. ^^^ |
#22113 redid all these utilities, I think we're set here now. |
.visible
utility class to make visibility: visible;.display-block
,.display-inline-block
,.display-inline
..hidden
class to setdisplay: none
; There are only hidden up/down for breakpoints.The text was updated successfully, but these errors were encountered: