-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add story title and tags as data attributes to the editor HTML #1440
Comments
Could you explain a little bit how you would use this feature in practice? |
To write rules such as |
Since you mention having interest in implementing this:
|
Not sure what you mean. Do you mean that you'd want to make a data attribute out of every attribute of the story object, presumably excluding |
Not necessarily every attribute. What I mean is something like this:
Other thing I forgot to mention is that it would be ideal if it was implemented as a hook, mainly to keep the complexity of StoryEditView down. I refactored out as much as I could into individual hooks because the component source code was getting really long. |
Hello! I wonder if this issue has been assigned to anyone. If not, my friend and I are interested in working on code that would implement this feature request. |
No one has done any work on this to my knowledge, but let's resolve things over on #1493 before you do work here. |
Hey @klembot was wondering if someone's working on it and if not then would be interested for the same! |
I have not done any work on it so far, so feel free @KlausMikhaelson |
Is your feature request related to a problem? Please describe.
The new
user.css
file allows the author to add custom styling to their Twine installation, but these styles are applied to all stories, and there is nothing in the current document html structure that would allow styles to be scoped to a particular story.If the current story title, and tags, were added as data attributes in the editor HTML structure, ideally on the
<html>
element, then it would be possible to write scoped CSS for particular stories.Describe the solution you'd like.
Add a
data-story-title
attribute to the<html>
or<body>
element of the editor, containing the current story title.Add a
data-story-tags
attribute to the same element with a list of the story tags.Describe alternatives you've considered.
An obvious alternative is multiple
user.css
files, one for each story/tag ... this would probably get quickly out of hand.Another option would be to allow editor-customising CSS to be stored in the stories themselves, but this would be a much more extreme solution.
Additional context on this suggestion.
No response
Presubmission checklist
The text was updated successfully, but these errors were encountered: