The Definitive Guide to Dark Mode and Bootstrap 4 first. This code will make little sense if you don't read I'm tempted to just archive this and walk away - I'm not a dev after all.Īnd now back to the regular programming. more that 2 years later, still we have an incoherent non-starter. If not mine, then at least a functional variant. What's really disapointing is that when I started this - Bootstap-Dark was first published on the 14 th May 2020 - it was with the hopes that Dark Mode could be incorporated into BS. Note that I will attempt to align ' bootstrap-dark' variant only. 5.2 Beta) will moved over to the dev/v1.2.0 branch of this project. ⚠ In the meantime, any work aligning to BS current core repo (a.k.a. Dark Mode capability, in essence a dual theme driven by browser/OS preference, remains to be seen. The intent is clear - with CSS variables (for the color elements) - theming is much simpler. ![]() ![]() Not something I'm keen to do.Īs such - I will not be updating this project's main branch (thus it remains tied to the v5.1.3 release) until such time as it becomes clear in what direction Mark Otto et.al. Obviously, this makes this effort hyper-complex in that I need to account for several discrepancies and each component SCSS file is looking to become a spaghetti bowl of if-else's and switching variables. Yet more issues in the Beta are that not all components have been converted to CSS vars (yet?), the largest of these is all the form components - this adding more inconsistencies to the core. (This has been reported as an issue bootstrap#36458.) Other issues in Beta pertain to inconsistent use of CSS vars in the _variables.scss file, with some SCSS variables ( $xxx) used as constants in some cases with the underlying components converting that to CSS vars, and other _variables.scss variables used as var(-bs-*) declarations, and the underlying components not converting to CSS vars. thus negating the need for CSS vars in the first place as you'd just be duplicating the background-color: var(.) each time it's used (or needs to switch mode) and making for a much larger CSS file. , and then in the remaining SCSS, code in the switch over. In essance the fix for this is to declare 2 sets of vars in the :root. ![]() Specifically around the :root CSS vars, as one cannot body.dark :root (' -blackbox'), or even for that matter core's own (sounding a lot like ' -blackbox'). The addition of CSS variables also brings in some additional complexity in some of the variants (this project shows 6 methods of attaining dark mode with Bootstrap 5) - specifically the ' -nightshade' and ' -blackbox' variants have major issues in accommodating for CSS variables. Obviously, this greatly modifies the methodologies used in this POC and would in essence require a major re-write of the code. A note on current state (Bootstrap 5.2 Betas):ĭevelopment efforts back at Bootstrap 5's core repository are currently geared at converting all color to CSS variables. If you're after the same work for Bootstrap 4 please visit the vinorodrigues/bootstrap-dark repo. This is a follow up to The Definitive Guide to Dark Mode and Bootstrap 4 body of work, and pertains to Bootstrap 5 ( Github repo.). A continuation of the v4 Dark Mode POC, but this time for v5
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |