Live data from Hacker News

Pylon – Declarative layout primitives for CSS and HTML

almonk.github.io

51–60 of 78 posts

Re: Pylon – Declarative layout primitives for CSS and HTML

#51

I enjoy seeing other people's solution, but since I really learned the power of grid, most of this is overdone with flex. As an example, here's how you can make a vstack with grid. vstack { display:grid; } It's ridiculously simple and clean, works with all the elements without extra wrappers, no margins, no cleaning up trailing spaces, etc... add spacing class using "grid-gap" and it's the near perfect solution. The…

Only problem with grid vs flex is browser support. I opt for flex still because it's got better support.

Re: Pylon – Declarative layout primitives for CSS and HTML

#52

I enjoy seeing other people's solution, but since I really learned the power of grid, most of this is overdone with flex. As an example, here's how you can make a vstack with grid. vstack { display:grid; } It's ridiculously simple and clean, works with all the elements without extra wrappers, no margins, no cleaning up trailing spaces, etc... add spacing class using "grid-gap" and it's the near perfect solution. The…

Only problem with grid vs flex is browser support. I opt for flex still because it's got better support.

Since the topic is "new framework", I would not advise investing in a system that is not ideal long term just because of a very minor support percent difference today. (looks like 6% of the world based on caniuse.com, but your audience may vary of course)

The benefit of an assumption like "everything by default is vertical", then the few people without grid support, but with flex, will have a "mostly" ok display.

Also, it's not hard to have a fallback to flex for horizontal items. (the only place it would really matter)

Re: Pylon – Declarative layout primitives for CSS and HTML

#53
post #37

Earlier quoted context omitted.

They mix content and presentation. If you separate content from presentation, then you can have a presentation for desktop an another for mobile. Also, you can totally change the layout without the need to change your HTML, as showcased in http://www.csszengarden.com/

The whole concept of separated “content” form “presentation” in UI is a bunch of nonsense. Maybe it works somewhere in some very limited sense, but I’ve yet to see anything complex that separates these things.

The separation of content from presentation is one of the primary purposes of MVC frameworks. The model (content) is separated from the view (presentation) by an abstraction layer (controller).

Re: Pylon – Declarative layout primitives for CSS and HTML

#54
post #37

Earlier quoted context omitted.

They mix content and presentation. If you separate content from presentation, then you can have a presentation for desktop an another for mobile. Also, you can totally change the layout without the need to change your HTML, as showcased in http://www.csszengarden.com/

The whole concept of separated “content” form “presentation” in UI is a bunch of nonsense. Maybe it works somewhere in some very limited sense, but I’ve yet to see anything complex that separates these things.

It’s really not nonsense. Make a text file with line breaks to force a line length, and then make a non-trivial edit to the content. You’ll have to move all the line-breaks too. It’s awful.

If you’d instead left presentation to the display tool, you’d only need to change the content.

The HTML presentation/content argument is this scaled up.

Re: Pylon – Declarative layout primitives for CSS and HTML

#55
Very cool, but I'd like to point out that unless/until this gets very popular to where Google changes their practices, it wrecks certain SEO perks (though so do a lot of fancy practices). Google still really likes plain old HTML primitives like or for lists, for tables,

for paragraph. Their featured snippets appear to be capable of extracting info that isn't in that form and bumping it to the top of results, but to prefer not to. My $.02 from starting to learn that game.

Re: Pylon – Declarative layout primitives for CSS and HTML

#56
Reminds me very much of XUL, Mozilla's XML-based language for UI. https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL

In a prior life I developed a slew of XUL apps, including a full-suite medical record system and billing system. It had its quirks, but for a developer-heavy (and design-light) firm it was a great way to build standard, predictable, and accessible UIs.

Re: Pylon – Declarative layout primitives for CSS and HTML

#57

Fun idea. The naming is weird as pylon used to be a python web framework but since it's not going to have any chance to become popular, overriding it seems alright.

I don’t know. Any package name that contains the string py makes me assume it’s python.

Re: Pylon – Declarative layout primitives for CSS and HTML

#58
post #37

Earlier quoted context omitted.

They mix content and presentation. If you separate content from presentation, then you can have a presentation for desktop an another for mobile. Also, you can totally change the layout without the need to change your HTML, as showcased in http://www.csszengarden.com/

The whole concept of separated “content” form “presentation” in UI is a bunch of nonsense. Maybe it works somewhere in some very limited sense, but I’ve yet to see anything complex that separates these things.

In the specific case of html and css I agree that it rarely works. There are a few examples like subreddit css, but in general html does to much layout to meaningfully separate content from layout. Xml and XSLT is a much better separation, with Xml containing pure content and Xslt transforming that into XHTML with CSS for presentation. But that never got much adoption.

In other domains separating content from presentation works well. But in web development the incentives don't align with that idea.

Re: Pylon – Declarative layout primitives for CSS and HTML

#60
post #24

Wow. So many kill-joys in this thread. I think the project is neat. It certainly is an opinionated way of doing a layout and it reads quite nicely. If CSS classes were provided as an alternative I think the project might have more adopters. Good work :)

Most of the critics seemed to be about pita caused by layout methods in general when rendering them on variable size screens, and not necessarily the Pylon methods themselves.

I agree with you, I think this is clean and easy to use.

Personally, I've stuck with Bootstrap for quite awhile now. It's not perfect but it's pretty good, well documented, and I work to keep it simple. So I don't really use a lot of what Bootstrap does and that's why this project appeals to me.

Post reply on HN