This content originally appeared on Bram.us and was authored by Bramus!
You can’t connect to a DB from within CSS, Right? Or can you?
Leveraging Houdini and SQL.js
— which is SQLite compiled to JavaScript to serve as in-memory DB — you can. Using some Custom Properties, you can pass in queries to be executed.
.query-display {
background: paint(sql-css);
}
main {
--sql-query: SELECT * FROM genre;
--sql-database: url(...);
}
Hahaha, just brilliant! 😅
Yes, I can connect to a DB in CSS →
SQL CSS →
Note that this is a tongue-in-cheek by the author, in response to this tweet mocking recruiters:
Recruiters be like:
We're looking for someone who can connect to the database using CSS.
— Memeloper (@iammemeloper) January 22, 2022
This content originally appeared on Bram.us and was authored by Bramus!
Bramus! | Sciencx (2022-02-07T17:06:46+00:00) Connect to a DB from CSS. Retrieved from https://www.scien.cx/2022/02/07/connect-to-a-db-from-css/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.