Using tailwind and jinja...
How to build a website without frameworks and tons of libraries
71–80 of 270 posts
Re: How to build a website without frameworks and tons of libraries
#72Earlier quoted context omitted.
> First, your dark mode is implemented wrong in the lazy corner-cutting way of doing JS post-load ... I agree with your whole comment, but the media query approach is also tricky. You typically still want to offer a toggle while respecting prefers-color-scheme, and you may want to give priority to whatever choice the user has made with that toggle if they've used it on your site before. This still requires JS and loc…
Doesn't that make the page completely unreadable for those few who have Javascript disabled though?
Re: How to build a website without frameworks and tons of libraries
#73This seems to fall into the 'simplistic, not simple' school of thought. You can have a relatively simple website if it doesn't do anything and if it cuts corners. Take your dark mode, which is just about the only nontrivial feature I see on this page. (One could also criticize the low contrast of the appearance and other problems, but that's less relevant to the simplicity thesis you're claiming.) First, your dark mo…
> First, your dark mode is implemented wrong in the lazy corner-cutting way of doing JS post-load ... I agree with your whole comment, but the media query approach is also tricky. You typically still want to offer a toggle while respecting prefers-color-scheme, and you may want to give priority to whatever choice the user has made with that toggle if they've used it on your site before. This still requires JS and loc…
Or you could use cookies. No need to mess with localStorage. Just set a cookie "prefersDarkMode" to true or false and have the backend send the right file. No need for an interactive backend, nginx can handle serving files based on cookie contents. No need for cookie popups/walls either.
Re: How to build a website without frameworks and tons of libraries
#74Slightly off-topic: His single "index.php" with jQuery is helping him to earn thousands per month. https://twitter.com/levelsio/status/1675829733668319233/phot...
I could also write his cool startup in just one line if I just remove all newlines. Does that make it even better than 14.000 lines? Obviously not.
Re: How to build a website without frameworks and tons of libraries
#75Edit: I noticed it's using "rem" for specifying the font size, and I've actually seen quite a few sites where the font sizes look wrong using that unit, I'm wondering if it's something specific to my system (but happens both with Chrome and Edge).
Re: How to build a website without frameworks and tons of libraries
#76It all feels a bit moot because most frameworks exist to create website that tend to be web apps If you just want static website well it's pretty easy to use any kind of simple templating system that will give you some html + css + optionnally js.
Hell you don't even have to generate the file, you can use CGI to generate your page on the fly with CGI (I like haserl)
If you like or are competent in dealing with quirks, you can do it all by hand instead.
I just got into webdev and I really like Svelte and SvelteKit so far.
Svelte works well if all you want is to colocate a bit of html, css and js. You can really start simple and iterate when you have bigger needs. Now, if I want to make a webapp I'll use SvelteKit even if only for the baked in client side routing based of the structure of the project.
Re: How to build a website without frameworks and tons of libraries
#77Earlier quoted context omitted.
> First, your dark mode is implemented wrong in the lazy corner-cutting way of doing JS post-load ... I agree with your whole comment, but the media query approach is also tricky. You typically still want to offer a toggle while respecting prefers-color-scheme, and you may want to give priority to whatever choice the user has made with that toggle if they've used it on your site before. This still requires JS and loc…
You can also swap out the CSS file for one that explicitly sets/unsets light/dark mode. This allows for a website that works in any browser even if your Javascript breaks or doesn't load. Or you could use cookies. No need to mess with localStorage. Just set a cookie "prefersDarkMode" to true or false and have the backend send the right file. No need for an interactive backend, nginx can handle serving files based on…
I just use for this. If you don't have Javascript you're just going to get whatever your prefers-color-scheme is set to. Users without JS don't expect things like a dark-mode toggle to work anyway.
Re: How to build a website without frameworks and tons of libraries
#78Slightly off-topic: His single "index.php" with jQuery is helping him to earn thousands per month. https://twitter.com/levelsio/status/1675829733668319233/phot...
Are there ways to view tweets without an account? Kind of like archive.is? For now, I could enter it in Google and view cache, but I assume that will go away soon. And if I understand correctly, it's not the index.php, but the actual service behind it, that earns thousands per month. Looks nice :)
Re: How to build a website without frameworks and tons of libraries
#79Re: How to build a website without frameworks and tons of libraries
#80A tiny mostly static website written by one person certainly doesn’t need anything special. A website/webapp with millions of visits per day and a ton of stakeholders requesting features every week, on the other hand... It all depends on the use case, like most stuff.