Readit News logoReadit News
charrondev commented on What Is Popover=Hint?   una.im/popover-hint/... · Posted by u/speckx
ronbenton · 22 days ago
>Stacking order when you have multiple modal dialogs and popovers in the top layer is based on most recently revealed element, so that toast that just opened is now hidden under a dialog.

Whenever I have to fight something like this it always makes me question the goodness of the pattern to begin with. Stacking multiple modals/popovers/tooltips can’t be a great UX (or accessibility) pattern, can it? I find at least half the time that I’m fighting the browsers it’s because I’m trying to do something suboptimal

charrondev · 22 days ago
Stacking modals is no good for sure, but just because a form is part of a modal doesn’t mean it should never be able to use a tooltip, dropdown, or popover.
charrondev commented on How we’re responding to The NYT’s data demands in order to protect user privacy   openai.com/index/response... · Posted by u/BUFU
vanattab · 3 months ago
Protect our privacy? Or protect thier right to piracy?
charrondev · 3 months ago
I mean the court is ordering them to retain user conversations at least until resolution of the court case (in case there is copyrighted responses being generated?).

So user privacy is definitely implicated.

charrondev commented on How to have the browser pick a contrasting color in CSS   webkit.org/blog/16929/con... · Posted by u/Kerrick
jjcm · 3 months ago
This is a great overview of the pros/cons of this. For those creating just a simple site, this is a solid easy way to have proper contrast.

For those making anything at a production scale where you need wcag compliance however, I'd avoid this and leverage a proper semantic token layer. Semantic tokens will help both accelerate your dev cycle, and they'll help guarantee proper contrast ratios in a way that looks visually better than just switching your foreground layer to black or white. The great thing about a semantic token layer is they're extremely easy to theme, which means you get light/dark theming for very little additional cost. You can also create separate WCAG2 / APCA accessible themes, should your brand color be one of the ones that WCAG2 has issues with - will get you compliance while still providing a better visual contrast option.

This is kind of my niche domain specialty - I run the variables/tokens stream at Figma, and I've worked on the dark mode implentation for both Figma and Atlassian. Happy to answer any questions about tokens/themes/accessible color.

charrondev · 3 months ago
What do you mean by semantic tokens?

This exact type of functionality has caused a major project a work on to use CSS in JS (for relative colors and contrast colors.

I’m glad to see this type of thing coming around the corner and look forward to it being widely available in a couple years.

charrondev commented on Why can't HTML alone do includes?   frontendmasters.com/blog/... · Posted by u/susam
masswerk · 4 months ago
Fun fact: this does work with iframes:

  <ul>
    <li><a href="about.html" target="display">about</a></li>
    <li><a href="contact.html" target="display">contact</a></li>
  </ul>

  <iframe src="about.html" name="display"></iframe>
The important part is that the target iframe must have a `name` attribute (not identified by `id`.) I guess, this is a legacy of framesets & frames.

(Of course, this has all the issues of framesets, as in deep linking, accessibility, etc.)

charrondev · 4 months ago
The worst part of frames is scrolling.

You have to give an iframe a specific height in pixels. There is no “make this iframe the height its content wants to be (like normal HTML).

This leads to two options:

- your page has nested vertical scroll bars (awful UX) - you have to write JavaScript inside and outside the frame to constantly measure and communicate how tall the frame wants to be.

Or you could just not use frames.

charrondev commented on Programming languages should have a tree traversal primitive   blog.tylerglaiel.com/p/pr... · Posted by u/azhenley
IshKebab · 4 months ago
I mean people do use iterator instead of for loops quite a lot.

IMO the thing that would be really nice is if control flow like `for` was actually the same as using an iterator. This would really help in Rust too where handling errors inside iterator callbacks is a right pain.

I've seen a few languages try this but it seems to not be very popular. I think it can get a bit confusing how control flow keywords like `return` and `break` work if you turn `if` into syntactic sugar for a function call taking a closure etc.

charrondev · 4 months ago
In what way is for different than an iterator?

In PHP you loop through an iterator with the foreach control structure.

In JavaScript you use for of.

In rust it’s for in.

What am I missing?

charrondev commented on Dialogue-only subtitles are finally making their way to Netflix   neowin.net/news/dialogue-... · Posted by u/bundie
laurencerowe · 4 months ago
I wish there was an option for a sound mix that let you hear the dialog without annoying your neighbours with the music and sound effects.

Im pretty sure it’s not just me getting old. Movies and series from the 1990s or early 2000s don’t have this problem. It’s like they are streaming the cinema mix rather than the home video mix.

charrondev · 4 months ago
Apple TVs have a mode that compresses dynamic range in sound and boosts dialogue.

Alternatively you could get a 3.1 audio setup and just boost the heck out of your center channel.

charrondev commented on Microsoft subtracts C/C++ extension from VS Code forks   theregister.com/2025/04/2... · Posted by u/Dotnaught
chilldsgn · 4 months ago
This is one of the reasons why I switched to CLion for C++ work, and the fact that VS Code and its derivatives was a pain to configure for C++.

I also use PHPStorm for web dev work and we use MS DevOps at work and that extension is unstable, causes IDE errors for me and I will not use MS products just for this one irksome bug. I prefer PHPStorm for my work, because working with PHP in VS Code has never been a great experience for me. I just want my tools to work, I fight with code, I don't want to fight with my tools as well.

charrondev · 4 months ago
I can also second the usage PHPStorm over VSCode for PHP work. On a team of 10 PHP devs we have just one that prefers VSCode.
charrondev commented on YAML: The Norway Problem (2022)   bram.us/2022/01/11/yaml-t... · Posted by u/carlos-menezes
throwawaymaths · 5 months ago
charrondev · 5 months ago
> I have been pressured multiple times by Brian Ingerson (one of the authors of the YAML specification) to remove this paragraph, despite him acknowledging that the actual incompatibilities exist. As I was personally bitten by this "JSON is YAML" lie, I refused and said I will continue to educate people about these issues, so others do not run into the same problem again and again. After this, Brian called me a (quote)complete and worthless idiot(unquote).

> In my opinion, instead of pressuring and insulting people who actually clarify issues with YAML and the wrong statements of some of its proponents, I would kindly suggest reading the JSON spec (which is not that difficult or long) and finally make YAML compatible to it, and educating users about the changes, instead of spreading lies about the real compatibility for many years and trying to silence people who point out that it isn't true.

> Addendum/2009: the YAML 1.2 spec is still incompatible with JSON, even though the incompatibilities have been documented (and are known to Brian) for many years and the spec makes explicit claims that YAML is a superset of JSON. It would be so easy to fix, but apparently, bullying people and corrupting userdata is so much easier.

Well that’s disappointing.

charrondev commented on YAML: The Norway Problem (2022)   bram.us/2022/01/11/yaml-t... · Posted by u/carlos-menezes
mannykannot · 5 months ago
Are there no cases where well-formed JSON could be subject to the problems covered in the article, when parsed by a compliant YAML parser? I'm asking because I know nothing about YAML and not much more about JSON.
charrondev · 5 months ago
Not that I know. JSON requires strings to be quoted which is basically the problem here. Of course it’s not a great human writable configuration format (no comments being a huge problem).

I’m just pointing out that it should be very simple to swap a YAML file for a JSON file in any system that accepts YAML

charrondev commented on YAML: The Norway Problem (2022)   bram.us/2022/01/11/yaml-t... · Posted by u/carlos-menezes
makeitdouble · 5 months ago
Sadly you usually realize you've been writing too much YAML way past the turning point, and it will be a pain to move a single file to JSON for instance when you have a whole process and system that otherwise ingest YAML, including keeping track of why this specific part of JSON and not YAML.

So people work around the little paper cuts, while still hitting the traps from time to time as they forget them.

> generate YAML

I've a hard time finding a situation where I'd want to do that. Usually YAML is chosen for human readability, but here we're already in a higher level language first. JSON sounds a more appropriate target most of the time ?

charrondev · 5 months ago
Isn’t yaml a strict superset of JSON? Any compliant YAML parser should be able to ingest a JSON document.

u/charrondev

KarmaCake day1185March 3, 2015
About
[ my public key: https://keybase.io/charrondev; my proof: https://keybase.io/charrondev/sigs/0sW6BkThCCdwzGnXARSPKXTuP2p11J6U9_267R519Tg ]
View Original