2024-03-03 13:48:51
It’s not wrong. But it’s not right, either.
“Creating Fluid Typography with the CSS clamp() Function”
https://www.sitepoint.com/fluid-typography-css-clamp-function/#:~…
💗 Setting And Persisting Color Scheme Preferences With CSS And A “Touch” Of JavaScript
https://smashingmagazine.com/2024/03/setting-persisting-color-scheme-preferences-css-javascript/
Quick tip: be careful when using the newer #CSS viewport-percentage length units like `svh`, `dvh`, and the like. They are well-supported since late 2022 and quite a few users might still be using older (Android) devices and browsers. So always make sure to test on a few real devices (thanks to my parents in law for their Galaxy Tab 4 😁) and provide fallbacks, e.g. with `vh`.
Added the poorly-named Looper Mini Web Machine to my post “CSS-only Widgets Are Inaccessible”:
https://adrianroselli.com/2023/03/css-only-widgets-are-inaccessible.html#Looper
They’re just mis-used radio buttons.
I have no idea …
Leap day, MEAP day!
All Manning early access books are 50% off today, including CSS in Depth
https://www.manning.com/books/css-in-depth-second-edition?a_aid=kjg&a_bid=a7bc24da&chan=mm_mastodon
Oh how useful text-emphasis would be if it didn’t affect line height.
#CSS
🔗 An Alternative Proposal for CSS Masonry
My initial gut reaction was of course masonry should be part of grid, but Rachel makes some very good points here. Whole segments of the grid specification would have to be ignored for a masonry layout, which she itemizes well. The way it would break grid-template-areas is a huge deal, IMO; that is the primary way a lot of developers use and understand grid. I think Rachel is right. Something like
My son asked for a little web dev challenge, so I tasked him with filtering a list with a few selects.
First of all: he solved it! 🥳
But when I looked at the code, I noticed that he had used HTML data attributes and was accessing them in JS via the dataset property. When I asked him about it, he replied: “Yes, I read that in a post by @… on …
Yikes. @… has coined the term "Kobold Letters", which use CSS nesting in email to make text invisible until it is forwarded. Clever and dangerous. There is an infinite number of ways to render text invisible, so this is basically impossible to stop.
https://lutrasecurity.com/en/articles/kobold-letters/ via @…
“Hanging punctuation in CSS ”
https://adactio.com/journal/21027
I wanted to avoid an additional selector to undo the style, but Safari 17.3 Does not exclude any in the `:not()`:
```
html :not(pre, input, select, textarea) {
hanging-punctuation: first last;
}
Cw: center
<style type="text/css">
.extracenter {
align-content: center;
align-items: center;
align-self: center;
justify-self: center;
justify-items: center;
justify-content: center;
place-content: center;
place-itens: center;
text-align: center;
margin-inline: auto;
margin-right: auto;
margin-left: auto;
margin: auto;
display: flex;
left: 50%;
right: 50%;
margin: auto;
line-height: 100%;
position: absolute;
vertical-align: middle;
transform: translate(-50%, -50%);
}
</style>
`<div class="extracenter">🏢</div>`
Moved kukei.eu website from CF Pages to express so it runs on my PC.
See a massive perf improvements as the website backend doesn't need to talk CF -> PC to get search index data and MongoDB stuff. Now it talks localhost in both way so the only round trip is between the user and the website server.
Drop is: 3s for entire document to 419ms (including search results generation!)
Over the last few weeks, I’ve been a really big fan of PicoCSS. Drop a #CSS file in an #HTML file, write some semantic HTML, and it looks nice.
https://picocs…
🔊 #NowPlaying on KEXP's #Early
CSS:
🎵 Let’s Make Love and Listen to Death From Above
#CSS
https://open.spotify.com/track/1Jd9W7k8DTnBSovDSxK77n
https://ahistoryofemptyrooms.bandcamp.com/track/lets-make-love-and-listen-to-death-from-above-css-cover
How To: Get all links with a CSS class and open them to find out redirects for translations of Thunderbird Knowledge Base articles using Ruby and Nokogiri: http://rolandtanglao.com/2024/03/26/p1-how-to-get-all-link-css-class-open-mechan…
Just updated my 2014 post “W3C CSS Odor Module Released” to mention GameScent, which spews smells at your face while you game:
https://adrianroselli.com/2012/04/w3c-css-odor-module-released.html#Update07
‘Within a month, its advent would have spawned a hundred thousand “hey guys!!” Youtube videos, 67 hastily written books, and 31 video courses hosted by creepy, immaculately preened white dudes.’
What is Utility-First CSS?: HeydonWorks
https://heydonworks.com/article/what-i
Nice! Old-school blogroll button in HTML CSS:
🤖 https://codepen.io/adamrice/pen/GReVPVy
/by @… via @…
🧱 Nue CSS: A scaleable alternative to Tailwind, BEM, and CSS-in-JS
#css
Months ago, we implemented heap.io for website analytics. We chose it for its autocapture feature. The promise was that as long as we had elements that could be located with CSS, we wouldn't need to define events before deploying code. Events could be defined at any time and work retroactively. It kinda worked, until we found out that their CSS selectors have DOM character limits. Say a section is locatable with "[content-type='hero']". Inside is a button with "[co…
Learning des heutigen Tages: Hacking ist gar nicht so schwer, wie ich dachte, ha!
Ich bin davon ausgegangen, dass man profunde IT-Kenntnisse benötigt, bevor man überhaupt anfängt. (Benötigt man sicherlich auch bei komplexeren Websites.)
Aber für semiprofessionelle Websites reichen einfach ein paar HTML-, CSS- und JavaScript-Kenntnisse für Einsteiger – oder nicht mal die. 1/2
Today for the first time ever I used CSS :has pseudo-class. Surprisingly, it happened at work, in a React project, because the hook-based logic was too convoluted to get the thing done.
I distinctly remember when I had to rewrite portions of my current blog template because :has wasn't supported in Firefox yet.
Viva la web.
#css
This https://arxiv.org/abs/2311.16402 has been replaced.
initial toot: https://mastoxiv.page/@arXiv_hepp…
If you use Quarto to make presentations for a professional setting, it is important to choose the right theme, e.g. #rstats
A common talking point of CSS & separation of concerns is the idea that you can just swap out the CSS for different CSS to have a whole new design.
That’s neat and all, but the real-world need is the opposite: the HTML changes ALL. THE. TIME. Write your CSS so it works with changing content.
#css #webdev
Today's #ReleaseSunday features a major update for the https://thi.ng/meta-css toolchain, a data-driven codegen for creating custom modular CSS frameworks, incl. transpiler, bundler, dev/watch mode...…
This https://arxiv.org/abs/2312.15308 has been replaced.
link: https://scholar.google.com/scholar?q=a
TIL `scrollbar-gutter: stable;`
It reserves space on the screen for the scrollbar so the page doesn't jump on scrollbar appearing / disappearing. I've started using the Transitions API and this CSS property is really clutch with Transitions.
Waiting on Safari to ship support though.
(75% support) https://<…
Moved kukei.eu website from CF Pages to express so it runs on my PC.
See a massive perf improvements as the website backend doesn't need to talk CF -> PC to get search index data and MongoDB stuff. Now it talks localhost in both way so the only round trip is between the user and the website server.
Drop is: 3s for entire document to 419ms (including search results generation!)
This a pretty wild bit of CSS:
https://camp2.rectangle.zone/index.php?title=Rotating_CSS_Tesseract_but_every_plane_is_a_Rotating_CSS_Cube
As someone else said "This is the loudest silent animation I’ve…
CSS is dandy. The DOM is great. Web development is fine. This is fine.
https://stackoverflow.com/a/77974405/239816
@… 3. Also related, yet feels somewhat separate: The cool whacky sites out there.
Again, maybe they exist now and we just aren’t sharing them, but I feel like I see a lot less “experiments” on the web. Sites that use HTML, CSS, and JS to just do something cool and unexpected. From playing fart noises to making cool colorful animations. I just don’t see t…
Am I imagining things, or are there features in web browsers’ developer tools to detect synthesized / faux font weights? #webdev #WebDevelopment #CSS
Does the new CSS light-dark() do anything to support sites that have a light mode/dark mode toggle switch?
Wondering if a no-CSS no-JS embed code would be useful or make sense? 🤔
#PhanpySocialDev (not on dev site yet) #MastoDev
GNarsil: Splitting Stabilizers into Gauges
Oskar Novak, Narayanan Rengaswamy
https://arxiv.org/abs/2404.18302 https://arxiv.org/pdf/2…
Not sure I can trust Digital Ocean as far as I can swim in it. Assuming this is really the CEO and it is really “committed” to CSS Tricks.
https://twitter.com/paddix/status/1763664036946985229
How to get the #css default back after setting a property on an element with #javascript? In my case display - element.style.removeProperty('display')!
been working on the CSS for my CV/portfolio/job-application stuff. even though i can't really imagine getting a job any time soon…
first order of business was cleaning it up using nesting selectors. it's nice, quite a bit cleaner. and how much memory did i save? it's a whole -29 bytes smaller now 🤔!
also damn, having "artifical intelligence" in my CVs interests section sounds soo damn lame now 😅.
Months ago, we implemented heap.io for website analytics. We chose it for its autocapture feature. The promise was that as long as we had elements that could be located with CSS, we wouldn't need to define events before deploying code. Events could be defined at any time and work retroactively. It kinda worked, until we found out that their CSS selectors have DOM character limits. Say a section is locatable with "[content-type='hero']". Inside is a button with "[co…
I think #CSSNakedDay is a fun idea!
I’m not participating myself, as I haven’t had time to fix my inline navigation SVGs looking confusingly *noir* without their CSS fills. But you should give these sites a visit! https://
Manning Flash Sale! 50% off all MEAPS today only.
Use code flash0424au to get half off CSS in Depth, Second Edition and loads of other great books
https://www.manning.com/books/css-in-depth-second-edition?a_aid=kjg&…
Just learned from @… that the text-wrap property in #CSS has two new(ish) values: balance and pretty.
“The balance value is good for headings, and tries to balance the number of characters on each line so that each line of the heading is about the same lengt…
Public request for help & suggestions: **I want to learn modern CSS**.
I have tried my hand using a CSS framework and had some success, but not reproducible and understandable success.
Where do I start?
I just let Claude write a short article about :has() as a test and while it got browser support wrong (probably because of older training data) the code examples turned out far better than those in the latest piece by DigitalOcean on CSS-Tricks… 🫣
❌ Writing CSS to avoid style tags
❌ Writing JavaScript to avoid writing CSS
❌ Writing TypeScript to avoid writing JavaScript
❌ Writing WASM to avoid writing TypeScript
✅ Using an LLM to avoid using brain
https://social.lol/@bw/112063887344206185
#TIL
CSS-Code inklusive media-queries lässt sich in SVG-Dateien einbetten. Dadurch können Grafiken unkompliziert einen dark mode bekommen. Sehr nützlich für den anstehenden relaunch der Seite von @…
I'm polishing the front end of a petproject and Im researching front-end design ideology. Right now it just spits out html with class attributes that tie in with a very rudimentary stylesheet.
The goal is allow user css customization of every element but also ensure its not *too* flexible as to break accessibility. So for example, striking a balance between html tables or just dumping everyting as divs and spans and let the grids/flexboxes sort it out.
I just let Claude write a short article about :has() as a test and while it got browser support wrong (probably because of older training data) the code examples turned out far better than those in the latest piece by DigitalOcean on CSS-Tricks… 🫣
@… laughing in the voice of that person who did the talk about doing css design for email templates during last @…
🔗 What is Utility-First CSS?
“Utility-first CSS is more radical. Utility-first CSS is exception-first CSS. And that’s not how exceptions work, in CSS or in general.”
Man, I love the Heydon snark on this one. He lays it on thick, and he’s spot on.
https://heydonworks.com/article/what-i
I rushed out a leap day post. Something something February 29.
“Techniques to Break Words”
#CSS
Quick heads up, highlight.js now correctly highlights code in namespaced tagged template strings (e.g., kitten.html``, kitten.css``, etc.)
https://github.com/highlightjs/highlight.js/pull/4002
(And Kitten comes with highlight.js baked in. See it in use in t…
CSS-Tricks might be back?
This first post in nearly a year is authored by a Digital Ocean dev advocate:
“Accessible Forms with Pseudo Classes”
https://css-tricks.com/accessible-forms-with-pseudo-classes/#comment-1808192
Yes, …
VERY disappointed in GitHub refusing to support the LaTeX `\colorbox` (outright banned) or `\textcolor` macros (seemingly only very limited support) or any CSS solution to allow one to create colored text in Markdown files... I was hoping to create color swatches as shown in the attached preview (in VSCode), but just none of this works on GitHub...
(And yes, I understand there're some potential accessibility issues, but there're more social solutions to address these than an ou…
#TIL
CSS-Code inklusive media-queries lässt sich in SVG-Dateien einbetten. Dadurch können Grafiken unkompliziert einen dark mode bekommen. Sehr nützlich für den anstehenden relaunch der Seite von @…
Holy cow this piece of custom CSS on YouTube results pages is ace:
```
ytd-shelf-renderer {
display: none;
}
```
*Seems* to get rid of the ‘recommended’ and ‘nobody also watched’ boxes where YouTube stuffs all the white supremacist shit (or in my case, videos of kids getting life sentences and videos of blisters).
The #css :has selector is a godsend. It's incredible how far styling has come on the internet.
OK, back to making my site banner.
Holy cow this piece of custom CSS on YouTube results pages is ace:
```
ytd-shelf-renderer {
display: none;
}
```
*Seems* to get rid of the ‘recommended’ and ‘nobody also watched’ boxes where YouTube stuffs all the white supremacist shit (or in my case, videos of kids getting life sentences and videos of blisters).
ICYMI, Chrome has said it intends to prototype the CSS property `reading-order-items`:
https://groups.google.com/a/chromium.org/g/blink-dev/c/d9jIhcVw8zQ/m/aM5d-3P7AQAJ
If this is new to you, I cover the broad challenges with readi…
VERY disappointed in GitHub refusing to support the LaTeX `\colorbox` (outright banned) or `\textcolor` macros (seemingly only very limited support) or any CSS solution to allow one to create colored text in Markdown files... I was hoping to create color swatches as shown in the attached preview (in VSCode), but just none of this works on GitHub...
(And yes, I understand there're some potential accessibility issues, but there're more social solutions to address these than an ou…
Three more chapters just dropped in the CSS in Depth MEAP!
Learn about web typography, gradients, and a whole array of effects like blend modes, filters, masks, and shapes.
https://www.manning.com/books/css-in-depth…
I *still* would love to be able to strip the unit from a value by dividing by 1 unit in #CSS calc()… 🤔
I am not such a CSS purist that I think utility classes have no place in development, but I do find advocating utility-first approaches (never mind the toxic bro culture driven by Tailwind’s CEO) to be a strong signal of being a wanker.
Heydon is more verbose:
https://heydonworks.com/article/wha…
New in Kitten¹: Markdown fragments
You can now write your Markdown in separate .fragment.md files and `import()` them as if they were JavaScript modules, just like you can with HTML and CSS fragments.
And while they don’t support props, they do support slots (including named slots, which you can use as poor man’s props.)
Enjoy!
:kitten: 💕
¹
@scope is now live in both Chrome and Safari! This is huge for #CSS. The remaining days of BEM are numbered!
https://keithjgrant.com/posts/2023/04/scoped-css-is-back/
#CSUNATC
CSS Accessibility: Inclusion Through User Choice
https://noti.st/cariefisher/qQ4jqu/css-accessibility-inclusion-through-user-choice…
@scope is now live in both Chrome and Safari! This is huge for #CSS. The remaining days of BEM are numbered!
https://keithjgrant.com/posts/2023/04/scoped-css-is-back/
Using this CSS with broken image ref:
```
::before {
content: url(foo) / "Panda";
}
```
Safari / macOS / iPadOS does not show the alt.
Until you turn on VO. Or turn it off. But it goes away if you refresh.
More accurately, it resizes the placeholder; if your alt is small enough to fit *then* it shows.
Attached video shows it in action.
So. What the deal is?
Test page:
Using this CSS with broken image ref:
```
::before {
content: url(foo) / "Panda";
}
```
Safari / macOS / iPadOS does not show the alt.
Until you turn on VO. Or turn it off. But it goes away if you refresh.
More accurately, it resizes the placeholder; if your alt is small enough to fit *then* it shows.
Attached video shows it in action.
So. What the deal is?
Test page:
Looks like fifth time might be the charm for Chrome to implement keyboard-friendly scrolling areas:
https://developer.chrome.com/blog/chrome-125-beta?hl=en#keyboard-focusable_scroll_containers
Updated my post: