klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

Add passage tags to `passage-card` element using data-tags #1438

Open hituro opened 1 year ago

hituro commented 1 year ago

Is your feature request related to a problem? Please describe.

Now that we have user.css I'd love to be able to style my passages differently based on their tags, but sadly that data isn't represented anywhere on the html structure.

Describe the solution you'd like.

Add a data-tags attribute to the passage-card element with a space separated list of passage tags so that custom user.css can target them.

Describe alternatives you've considered.

I tried using :has() to target a passage based on the colour of its tags, but Electron 18 doesn't support :has() so that's out.

Additional context on this suggestion.

No response

Presubmission checklist

klembot commented 1 year ago

The next minor release of Twine will include an Electron version bump, FWIW. I would target latest available when that happens.

rubynguyen1510 commented 9 months ago

Hello @klembot ,

While my friend and I were trying to fix this issue, we found in the Twine documentation that the HTML output of passagedata already has tags attribute. Does it mean that this issue can be closed without doing anything?

image

hituro commented 9 months ago

@rubynguyen1510 You have misunderstood the issue. This is not about placing an attribute on the exported HTML, but on the actual editor window when using Twine.