September 8th, 2024

Htmx, Raku and Pico CSS

The author simplifies web development using HTMX, Raku, and Pico CSS, emphasizing semantic HTML and dynamic content creation without JavaScript, while working on a project to rebuild HTMX examples.

Read original articleLink Icon
DelightFrustrationNostalgia
Htmx, Raku and Pico CSS

The blog post discusses the author's approach to simplifying web development by utilizing HTMX, Raku, and Pico CSS. The author aims to reduce cognitive load in web projects by returning to a simpler structure reminiscent of early web design, where HTML is used for layout and CSS for styling. HTMX is highlighted for its ability to create dynamic web content without relying on JavaScript, making it suitable for most web applications, though not for complex platforms like Facebook or Google Maps. The author emphasizes the importance of semantic HTML, which enhances the meaning and structure of web pages. Pico CSS is presented as a favorable CSS framework that aligns with the author's goals, as it avoids cluttering HTML with excessive attributes, unlike Bootstrap and Tailwind. The post also mentions the author's ongoing project to rebuild HTMX examples using Raku and Cro, with a focus on creating a tab component, while acknowledging that Pico CSS supports dark mode. The author invites readers to engage with the content and share their thoughts.

- The author aims to simplify web development using HTMX, Raku, and Pico CSS.

- HTMX allows for dynamic content creation without JavaScript, suitable for most web applications.

- Semantic HTML is emphasized for improving the structure and meaning of web pages.

- Pico CSS is preferred for its clean approach to styling, avoiding excessive HTML attributes.

- The author is working on a project to rebuild HTMX examples with Raku and Cro, focusing on usability.

AI: What people are saying
The comments reflect a mix of experiences and opinions regarding HTMX, Raku, and web development practices.
  • Many users appreciate HTMX for reducing the need for client-side JavaScript and enabling faster feature development.
  • There is a sentiment of nostalgia for simpler web development practices, with some commenters expressing frustration over the complexity of modern front-end frameworks.
  • Discussions around the semantic use of HTML and the implications of using JavaScript libraries for basic functionalities highlight concerns about best practices.
  • Some users are exploring alternatives like Unpoly and expressing curiosity about classless CSS frameworks.
  • Raku receives positive mentions, indicating interest in its features and potential in web development.
Link Icon 20 comments
By @simonbarker87 - 2 months
I’ve been using htmx for over a year now for our internal management application (order monitoring, partner management, CAD model uploading and management type stuff) and I continue to be delighted at how quickly I can add features and iterate existing ones. I write way less client side JS, the app is very fast and responsive and I don’t have to write the app twice like with a SPA + API.
By @nanis - 2 months
> I am a simple sole, ... go back to the halcyon early days of the web before Netscape dropped the JS-bomb. You know HTML for the layout and CSS for the style.

I am not sure if this is intended as humor, but JavaScript came before CSS.

By @karaterobot - 2 months
> As we have seen in the previous posts, HTMX eliminates the need for JS to make dynamic web content.

Well, sort of! I suppose that for certain definitions of eliminating Javascript, this Javascript framework eliminates the need for Javascript completely.

By @eddyg - 2 months
Raku is such a fantastic, feature-laden language. Cool to see it get a (tiny) bit of HN attention!
By @chris_armstrong - 2 months
> I am a simple sole, I want to reduce the cognitive load in my web projects. The general idea is to go back to the halcyon early days of the web before Netscape dropped the JS-bomb. You know HTML for the layout and CSS for the style. An elegant division of roles.

(I'm not quite sure if this is the author's sentiment), but the point shouldn't be to escape JS entirely, but make it into something that can be used in a repeated pattern that works in lockstep with your application, such that you are neither creating custom JS for each page (e.g. React), nor blindly manipulating the DOM (like JQuery).

The division of roles between CSS and HTML is an almost contradictory point - your styling and layout should be coupled if you are to impose any meaningful order in your design. If you are rejecting the "decoupling" of front-end and back-end that React gives you, then why would you expect to be able to do it between HTML and CSS?

By @murkt - 2 months
HTMX, Unpoly and Twinspark are great, can't say anything about Raku.

I also really liked an idea about class-less CSS frameworks, as I was frustrated with all the `<table class="table">` and so on. Then I've tried it for one project where I had to integrate Leaflet map on a page. And it's just not possible to do with class-less CSS frameworks.

Since then I write `<table class="table">` and have zero problems with that.

By @jakelazaroff - 2 months
The main example in this article — immediately following a section on semantic HTML — is a list of <a> tags with the hrefs all set to `#` and the hyperlink behavior emulated with htmx. So we’ve taken what would otherwise be a perfectly functional list of links, removed the most important semantic attribute, broken a bunch of behavior and rendered them useless without a ~16kb JavaScript library.

…and look, that’s an okay mistake to make — it takes time to learn this stuff — but when you also go out of the way to pine for “the halcyon early days of the web before Netscape dropped the JS-bomb” it makes it difficult to take you seriously. A list of links is, like, the most basic essence of a website; if you aren’t able to make that work without a JavaScript library, what are you even pining for?

By @bravura - 2 months
I'm just curious if anyone is using unpoly instead of HTMX?

I know that HTMX has a much larger userbase, its main dev is well known and beloved, and the landing page doesn't look web 1.0

With that said, unpoly appears to have a similar feature set and one feature that HTMX doesn't: The ability to create modals without loading a new page.

By @sergiotapia - 2 months
i know tailwind wasn't created in a vacuum and solves a massive problem. but part of me does feel sad it "won" and now we all are forced to deal with it in one way or another. i remember when HTML was clean and semantic, and crawlable. there was a certain respect in that way.
By @mixmastamyk - 2 months
Pico looks like it may be the classless styler I was looking for, thanks.
By @fragmede - 2 months
(sole = bottom of shoe

soul = spiritual part of a human)

By @stephankoelle - 2 months
Recently, I’ve been working with Quarkus[1], the quarkus-qute[2] (a type-safe templating engine), and htmx. I found the experience quite positive. Quarkus offers lightning-fast compilation with a hot-reloading Maven wrapper (mvnw), making development seamless. Picking up qute was straightforward, and combining it with htmx, especially with qute’s #fragment support for htmx, felt like a natural fit.

[1] https://quarkus.io/

[2] https://quarkus.io/guides/qute

By @allan_s - 2 months
For the "semantic web" part, what we've been using in my company recently , is the `<x-something>` tag which are valid html5

so except if there's a really fitting html5 tags (like footer, h1 , main ), we will have `<x-card>` `<x-avatar><img ></x-avatar>` (In case we must have an additional ) so that it's easier to convey the semantic (especially when looking in the dom inspector)

for the css we've been using tailwind (and couldn't be happier), but for personnal projects I guess picocss would be a really nice fit with `<x-semantic>` tags

By @niutech - 2 months
Better than using HTMX - 48KB of JS - use my PHOOOS technique (https://kodus.pl) with pure HTML out-ouf-order streaming, pure CSS framework Spectre.css (https://niutech.github.io/spectre/) and a sprinkle of 166B (bytes, not KB!) HTMZ (https://leanrada.com/htmz/) for extra interactivity.
By @monkmartinez - 2 months
I hope you are not a sole, and have the complete human embodiment of a soul. Otherwise, yes, I agree. My one off projects use more and more cdn loaded information. I love pico, bulma and htmx.
By @mediumsmart - 2 months
I do believe this is still in the first half of the rococo phase and that rubble is a long way off so by all means, carry on.
By @cantSpellSober - 2 months
Why Pico specifically? Lots of classless frameworks.

> I am a simple sole [sic]

`href=#` + JS library + config file + setting routes for each tab button doesn't feel simple

By @exabrial - 2 months
> While HTMX is well suited to 90% of this, if you are building a webapp like FaceBook […], then it’s not for you

I completely completely disagree. This is all you need.

By @fny - 2 months
I have been in web dev since 1999, and recently switched to a backend role.

I am never going back.

The endless thrashing on front end borders on psychosis. Something is clearly broken, and that thing is my feeble mind.