Why would you build a switch instead of relying on the user’s system settings? The only reason I can imagine is that your dark/light mode is not usable/readable so it forces the user to switch
I often use different light/dark settings between apps and my system. Just because I want system UIs to be dark, for example, doesn't mean I want to read long pages of white-on-black prose on your blog.
Seconded. Just because I like to have the browser toolbar dark and GitHub dark doesn't mean I also want to read lengthy articles (LWN) in thin white text on a black background.
My specific usage is a site to host my own internal training content.
I want to read it in dark mode and give users that option, but I want to present it in light mode because dark mode suffers poorly from video compression when screen sharing.
I currently have a JS toggle for it which uses local browser storage, but ditching JS would be nice if possible.
Having it default to the users preference is nice, but you should still provide an override. I sometimes use my browser in light mode while my OS is dark mode. Many times, I find the contrast for dark mode websites too low unless I’m in a totally dark room.
It is actually a reaction to websites doing stupid things to try and prevent password auto-fill. The sites are fighting against security in a misguided attempt to improve security, so the browser vendors added a bunch of heuristics to try and correct these situations and you end up with the mess we have.
Equally having to jump through extra hoops to prevent autocomplete where you don't want it is frustrating, like in admin interfaces where you might be updating someone else's name.
> Have they switched of JavaScript? Because people still do.
As an experiment I tend to disable JavaScript periodically. It is amazing how fast and responsive applications become. The amount of cruft that is downloaded is insane! Typically my experiments end after a month or so, because a lot of website don’t work _at all_ with JavaScript disabled.
I generally browse with JS disabled, most things I read "just work".
To achieve this I make use of uMatrix, with the global default being JS disabled, and CSS disabled. Then for sites where I consider it worth the cost, and value the content, I selectively enable JS.
Now one other reason I could give for why not JS would be screen readers, I imagine in content does not render without JS being active, those readers may well be rendered inoperative. Or at best very poor to interact with.
Costing money is one thing, but not throttling a queue consuming serverless function and effectively DDOSsing yourself is the true horror story working with serverless :)
There's no end of stories of people discovering 10s to thousand in bill run up on AWS (ir Azure or GCP) because they foot gunned themselves and didn't set up alerts and/or automated service suspension using the cloud providers available tools.
Part of me thinks you shouldn't be allowed to provision EC2/S3/Lambda/whatever without first having set up a Cloudwatch alert and a rule to stop your service if your bill goes past expected/acceptable limits.
Of course Amazon (or Microsoft or Google) could make that _way_ easier than they do. It'd be nice if there was a simple form in your account setting where you could configure it to suspend services if your projected monthly bill passed $limit.
I think it's a more generic "horror story of working with other people's computers".
I am curious what you - and with you more proponents of Tailwind in this thread - mean with “component” and “component framework”? I’m also Zen-garden age and with my very limited React experience this does sound like you are meaning a component framework like React, correct?
If so; what would be the motivation for using JavaScript to style a button? Call me old - my coworkers do -, but that feels counterintuitive.
Please note that I haven’t really formed an opinion on Tailwind yet. This is an honest question.
Component in this sense is typically just "a composable unit of UI". That often corresponds well with JS frameworks that want to be able to attach state and behaviour to those units, but you can have components without needing Javascript.
For example, partials in classic server-side rendering libraries can be thought of as components, although they tend not be used at such small scales. In CSS patterns like BEM, the B ("Block") is in many ways a component with different sub-elements and states. This is partly why Tailwind provides the @apply directive - it allows you to create "CSS only" components even if you don't have other ways of creating components. That said, other forms of components are often easier to use, and if you already are using them, Tailwind recommends using them for style reuse rather than @apply.
By "component framework" I was honestly thinking of React, Svelte, Vue, Solid, Qwik, and Angular, though I don't actually have experiences withh all of those.
I also don't have experience with native webcomponents or HTMX but I believe it would apply to those as well.
I do have experience with HTML templating such as Jinja and ERB and it would absolutely apply to those as well (though I don't think those would count as component frameworks, and certainly wasn't what I had in mind)
Basically some system which allows you to write some "unit" of markup such as
Which represents some logical unit which should be displayed in a consistent manner (with allowed exceptions, you can style the first and last of the result list differently using CSS selectors or tailwind classes)
With Tailwind, you just drop in the class names you want to spruce those up, and your component framework or templating library will give you a way to render a series of them with different properties. You have to repeat neither the markup nor the class names for multiple items
This is possible with CSS of course: Just add rules that apply to `li.search-item-result`, `li.search-item-result>div:first-child`, `li.search-item-result>div:last-child` but this creates a number of problems for maintainability. Say you want to wrap the first div in another element, or change the tag type, or add a spacer element before it. Now you have to repoint your CSS rules.
Additionally you have to think about the cascade, and how your CSS rules might apply to elements you didn't intend them too.
There are numerous systems for resolving these issues (BEM mentioned by the sibling commenter being one of them), but you end up writing a bunch of class names (and IDs for elements you only intend to render once on the page) which you have to name and reference. Then you have to probe devtools to determine which rules apply to which elements.
I can empathize with devs who have their own systems dialed in and don't think Tailwind brings them much value here, but if you don't have that system dialed in or just don't like thinking about names and specificity, it's a massive boon. Also, you end up writing a lot less code altogether since you don't have to write selectors or custom class names for everything you want to target precisely.
What strikes me about ChatGPT is the blatantly wrong answers it can give. I asked ChatGPT to solve a augmented matrix using gaussian elimination, and it failed in this straightforward task spectacularly.
Perfect example of "confident sounding hallucinations", I was just googling (a moment ago) why olive oil caused a burning sensation. It turns out there's a substance called oleocanthol[1] and there are receptors for that mainly in the throat. But while googling it, I see on Quora (which made it to the previews on Google) an "Assistant - Bot" response that is completely wrong: "Drinking olive oil can cause a burning sensation in the back of your throat due to its high fat content[...]"[2]
It wouldn't be notable if someone specifically asked ChatGPT, knowing its limitation, but using it to automatically populate Quora and Google with it is pretty bad. People are using LLM to fill the web with BS.
One is dumb as a brick, then other isn't. If you don't specify, then your comment should be dismissed out of hand.
Also, it's a well-known limitation of all current LLMs that they're terrible at basic algebra. Instead of trying to replace BLAS or Maple with it, ask it to write the Python code or produce the Mathematica expression.
This issue is not caused by OAuth, but by offering authentication via a third party. If you allow visitors to authenticate via a third party, you implicitly trust that third party. If that third party decides to revoke your account, then the logical consequence is that you can no longer authenticate. There’s no solution for this problem imo, other than not allowing authentication via a third party.
It is the same as airlines; They want you to identify using a passport. If your country decides to revoke your passport, you cannot check-in. That’s not an issue, but a logical consequence of choices made.
The trouble is that you can, apparently, have only one trusted third party. You can't have a backup authentication service in case the trusted third party fails. That's what's needed.
I'd like to have a regulated entity such as a bank, or even the California DMV, as a backup authentication provider. They have legal obligations that Google does not.
You'd need a law saying that the California DMV or whoever must run an oauth service, and then you'd see people integrate it. As it stands, this isn't a thing because the California DMV and even banks aren't interested in being the populus' IDP.
reply