Skip to content
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 /css-var slash command #3284

Merged
merged 3 commits into from
Jan 9, 2025
Merged

Add /css-var slash command #3284

merged 3 commits into from
Jan 9, 2025

Conversation

Wolfsblvt
Copy link
Collaborator

I made it on purpose that you can only set actual variables.
I don't think overwriting CSS properties via slash commands is good.

But this way, you can just use Custom CSS and then dynamically change the vars for those that you created.
Or overwrite a few of the default ones, like the examples that I have provided.

Changes

  • Add /css-var slash command to set CSS variables on some elements
  • Update gallery div id to something actually unique ("#draggable_gallery")

Checklist:

- Add /css-var slash command to set CSS variables on some elements
- Update gallery div id to something actually unique ("#draggable_gallery")
@Wolfsblvt Wolfsblvt added 🟩 PR - Small <100 lines changed 👷 Maintainer [ISSUE][PR] Posts by a maintainer or author of SillyTavern ✨ New Feature [PR] Contains implementation of a new feature 📜 STscript [PR][ISSUE] Related to STscript and/or Slash Commands labels Jan 9, 2025
@Wolfsblvt Wolfsblvt requested a review from Cohee1207 January 9, 2025 17:41
@Cohee1207
Copy link
Member

Nice to have in the future: an enumeration of common CSS variables.

For reference: https://stackoverflow.com/questions/48760274/get-all-css-root-variables-in-array-using-javascript-and-change-the-values

@Wolfsblvt
Copy link
Collaborator Author

Nice to have in the future: an enumeration of common CSS variables.

That's actually a pretty cool idea. I'll note it down for when I have time.
Maybe I can even check if you could get the var value of a CSS var for an element. Shouldn't be too hard. Worst case it's manually traversing the DOM up until you find it. Then we can add a slash command for getting the current value for those as well.

@Cohee1207 Cohee1207 merged commit 1807af3 into staging Jan 9, 2025
2 checks passed
@Cohee1207 Cohee1207 deleted the css-var-slash-command branch January 9, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👷 Maintainer [ISSUE][PR] Posts by a maintainer or author of SillyTavern ✨ New Feature [PR] Contains implementation of a new feature 🟩 PR - Small <100 lines changed 📜 STscript [PR][ISSUE] Related to STscript and/or Slash Commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants