Start a new topic

add helper data- attributes for userscripts/userstyles

Since cohost uses tailwind (or at least something similar, idk), the existing css classes can be hard to work with when making userscripts​/​userstyles​/​extensions​/​etcIt would be very helpful for that use case if there were some data- attributes (or classes/ids/anything css selectable) added to various things to make them easier to identify.

as an example, the tags section of a post currently looks like this:

<div class="w-full max-w-full p-3">
  <div class="relative w-full overflow-y-hidden break-words leading-none text-gray-400 ">
      <a class="mr-2 inline-block text-sm text-gray-400 hover:underline" href="">#tag</a>

there's no classes or other attributes unique to tags there. just writing a selector for the classes that are there could lead to false positives from similarly styled things elsewhere in the page, and it could stop working after a change to the style of the site.

if some helper things were added to the page, for example like this:

<div class="..." data-foo="tags-container">
  <div class="...">
      <a class="..." data-foo="tag" href="">#tag</a>

selecting them would be a lot easier.

5 people like this idea

I can't imagine this is high priority feature for most people, but as someone with low vision, being able to create user styles would be unbelievably helpful. It's technically possible right now, but difficult and inconsistent for the reasons that amgg laid out. I am politely begging for this suggestion to be implemented.

3 people like this

I would really like this to be implemented, I write styles and scripts and I do get the feeling that the hacky selectors I need to use will definitely break in the future. I made a topic about this before, I didn't notice this topic.

1 person likes this
Login or Signup to post a comment