Skip to content

Conversation

Leilei332
Copy link
Contributor

@Leilei332 Leilei332 commented Oct 11, 2025

This PR adds a stylesheet to intergrate palette colors and theme settings to CSS custom properties

Compared to using wikitext syntax, using custom CSS properties has these benefits:

  • var() is more advanced, it supports fallback.
  • Theme creators can use vanilla CSS instead of mixing CSS and wikitext. This allows editors to highlight CSS properly and check errors.

TODO

  • Add palette color properties
  • Add tiddlywiki style settings properties
  • Update docs

Copy link

netlify bot commented Oct 11, 2025

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 5b41130
🔍 Latest deploy log https://app.netlify.com/projects/tiddlywiki-previews/deploys/68f21b2083c23b00084b63a5
😎 Deploy Preview https://deploy-preview-9333--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

Confirmed: Leilei332 has already signed the Contributor License Agreement (see contributing.md)

Copy link

github-actions bot commented Oct 11, 2025

📊 Build Size Comparison: empty.html

Branch Size
Base (master) 2421.1 KB
PR 2433.4 KB

Diff: ⬆️ Increase: +12.3 KB

@Leilei332 Leilei332 marked this pull request as draft October 11, 2025 11:12
/* Tiddlywiki's CSS properties */

:root {
--tc-alert-background: <<colour alert-background>>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tc- prefix is used for TW class names. So IMO it will be confusing if we use it for CSS variables too.

tv- is used for TW variables. So imo --tv- can be used for CSS variables. This would be more consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually c stands for color here. In custom properties there is no classes, but there exists color data type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Leilei332 I do think that using tc- is confusing, and we need to adopt a different prefix here. Many appropriate prefixes have already been used (eg tv- which is used for TW system variables).

Perhaps we might introduce a new v- prefix for CSS variable, so you’d have v-alert-background etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Leilei332 I do think that using tc- is confusing, and we need to adopt a different prefix here. Many appropriate prefixes have already been used (eg tv- which is used for TW system variables).

Perhaps we might introduce a new v- prefix for CSS variable, so you’d have v-alert-background etc.

If we don't care about the potential name conflict between CSS settings and palette colors, I think tp- prefix is acceptable. If we do care, we may use tp-c- prefix.

Copy link
Member

@pmario pmario Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think --cc- for CSS color and
--cp- for CSS parameter would be OK and consistent.

It avoids name clashes with user CSS variables, so they do not use any prefix. It's also easy to discuss at Talk. Users may use a shortcut for cc-variables or cp-variables -- It's not correct, but we still will know what is meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think --cc- for CSS color and
--cp- for CSS parameter would be OK and consistent.

It avoids name clashes with user CSS variables, so they do not use any prefix. It's also easy to discuss at Talk. Users may use a shortcut for cc-variables or cp-variables -- It's not correct, but we still will know what is meant.

This isn't acceptable. It can't show that this custom property is only for tiddlywiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants