frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

CSS as a Query Language

https://evdc.me/blog/css-query
22•evnc•1h ago

Comments

efortis•1h ago
Not sure I follow the scenario this would solve.

For instance, currently you can conditionally change a parent based on its children. For example, this `pre` could either have 16px or 0px of padding. Zero when its direct child is a `code` element.

  pre {
    padding: 16px;

    &:has(> code) {
      padding: 0;
    }
  }
tadfisher•29m ago
The article describes a syntax for modifying the underlying data (adding new child elements or attributes to the DOM) for matching selectors, not resolving style changes in a single pass like you've shown.
capitainenemo•12m ago
I suspect they are replying to this part of the article: "What you actually want to say is: “an element is effectively-dark if it has data-theme=”dark”, or if it has an effectively-dark ancestor with no effectively-light ancestor in between.” That’s a recursive relational definition. CSS cannot express it. CSSLog can:"

The entire article doesn't seem to mention the existence of :has() which is rather surprising given how recently it was written. Not even in the footnotes.

k1m•57m ago
I find CSS selectors a lot easier to write than XPath. I recently gave a talk on how PHP's new DOM API makes working with HTML and CSS selectors natively very easy (previously you had to convert CSS to XPath).[1]

It's a shame that because CSS is still primarily for browser use and styling, we don't get nice things like the ability to select based on text content like we can with XPath. My understanding is that this was proposed but didn't make it into the spec because it could lead to performance issues in a browser rendering context.

[1] https://speakerdeck.com/keyvan/parsing-html-with-php-8-dot-4...

zerocrates•41m ago
Yeah, querySelector/querySelectorAll are totally widespread in client-side, it's nice to finally have them in PHP's newer DOM. Definitely what people are used to doing.
duncanfwalker•28m ago
Reminds me of seeing this presented at a conference years ago https://github.com/braposo/graphql-css

It was a joke but I really like the way it pointed out how we copy and reapply patterns in different contexts and that might enable unexpected things.

spookylukey•11m ago
The project pyastgrep https://pyastgrep.readthedocs.io/en/latest/ can use CSS selectors as a query language for Python syntax (default is XPath).

e.g.:

pyastgrep --css 'Call > func > Name#main'

Microsoft's Wave of Executive Departures

https://www.theverge.com/tech/917361/microsoft-executive-departures-notepad
1•cdrnsf•46s ago•0 comments

TIPSv2: Advancing Vision-Language Pretraining with Enhanced Patch-Text Alignment

https://gdm-tipsv2.github.io/
1•gmays•2m ago•0 comments

LLMs are pretty good at making slideshows now

https://iter.ca/post/llm-slideshows/
1•smitop•4m ago•0 comments

Show HN: ffmpeg-render-pro – Parallel video rendering with live dashboard

https://www.npmjs.com/package/ffmpeg-render-pro/v/1.2.0?activeTab=readme
1•beeswaxpat•6m ago•0 comments

RLMs process inputs up to two orders of magnitude beyond model context windows

https://github.com/alexzhang13/rlm
1•blumomo•7m ago•0 comments

Support Put, Patch, and Delete in HTML Forms

https://alexanderpetros.com/triptych/form-http-methods
1•acabal•8m ago•0 comments

Solve identity consistency problem for foundational image models

https://www.photalabs.com/blog/every-frontier-model-can-be-personalized-for-you/
1•ykhli•8m ago•0 comments

Show HN: HNswered – watches for replies to your Hacker News posts and comments

https://github.com/adam-s/HNswered
1•dataviz1000•10m ago•0 comments

Simple 3D Modeler on Web

https://sinter-3d.com/
2•db1024•14m ago•1 comments

Google Commits to Invest Up to $40B in Anthropic

https://www.nytimes.com/2026/04/24/technology/google-anthropic-investment-artificial-intelligence...
2•xnx•16m ago•0 comments

Cohere to Acquire Aleph Alpha

https://www.ft.com/content/4492c0d6-855b-4164-9ae5-f4d855a95f1e
2•mkirchner•20m ago•0 comments

What Is APL and What Can APL Do for You? (2024) [video]

https://www.youtube.com/watch?v=-5mSOyr8roc
2•tosh•22m ago•0 comments

Join the Choredle Android Beta Testers List

https://app.choreodle.com/#mlb2-40174361
1•mohanjith•23m ago•1 comments

The Geometry of Forgetting

https://arxiv.org/abs/2604.06222
2•ashwing1984•26m ago•0 comments

Use Built-In VPN in Firefox

https://support.mozilla.org/en-US/kb/built-in-vpn
1•HelloUsername•27m ago•0 comments

The Classic American Diner

https://blogs.loc.gov/picturethis/2026/04/the-classic-american-diner/
3•NaOH•29m ago•0 comments

Relays for Nimony's Standard Library

https://nim-lang.org/araq/relays.html
1•moigagoo•32m ago•0 comments

Show HN: I'm 15 and built a cryptographic accountability layer for AI agents

https://github.com/arian-gogani/nobulex
1•arian_•34m ago•0 comments

mine: A complete, no-frills IDE for Coalton and Common Lisp

https://twitter.com/stylewarning/status/2047736414704435535
2•tosh•37m ago•0 comments

Ubuntu 26.04 Released

https://discourse.ubuntu.com/t/ubuntu-26-04-resolute-raccoon-lts-released/80833
4•synergy20•37m ago•2 comments

AI Agent Designs a RISC-V CPU Core from Scratch

https://spectrum.ieee.org/ai-chip-design
2•Teever•39m ago•0 comments

APL\? (1990)

https://dl.acm.org/doi/epdf/10.1145/97811.97845
2•tosh•41m ago•0 comments

MiniZinc, constraint modelling language solve discrete optimisation problems

https://www.minizinc.org
2•Alifatisk•43m ago•0 comments

FluxBB Built with Rust

https://github.com/skorotkiewicz/fluxbb-rs
2•modinfo•46m ago•0 comments

'Startup Cowboys' Are Making This Texas Town the New Tech Hotspot

https://www.wsj.com/business/entrepreneurship/lockhart-texas-tech-hub-fd1bf380
2•malshe•47m ago•2 comments

A P2P Network for Collaborative AI Code Optimization

https://community.computer/
1•aiw1nt3rs•47m ago•0 comments

Before Apple Music, There Was MapleMusic–Canada's Forgotten Pioneer

https://thewalrus.ca/before-apple-music-there-was-maplemusic/
1•janandonly•47m ago•0 comments

QR Lume – a privacy‑first iOS tool for inspecting QR codes safely

https://apps.apple.com/us/app/qrlume/id6762032298
1•briwandt•48m ago•2 comments

Wsl9x: Windows 9x Subsystem for Linux

https://codeberg.org/hails/wsl9x
1•birdculture•49m ago•1 comments

Mercedes-Benz and Liquid AI Partner to Scale Embedded In-Car Intelligence

https://www.businesswire.com/news/home/20260423009970/en/Mercedes-Benz-and-Liquid-AI-Partner-to-S...
1•mnewme•50m ago•0 comments