Skip to content

Comments

chore(css): moves all our sass usage to CSS props via XTheme#4623

Open
johncowen wants to merge 8 commits intokumahq:masterfrom
johncowen:chore/x-theme-vars
Open

chore(css): moves all our sass usage to CSS props via XTheme#4623
johncowen wants to merge 8 commits intokumahq:masterfrom
johncowen:chore/x-theme-vars

Conversation

@johncowen
Copy link
Contributor

@johncowen johncowen commented Feb 17, 2026

We want to be in a position where we can easily theme our application (e.g. light/dark).

This PR is a step towards that by moving the majority of our build-time/static SASS vars to use runtime/dynamic CSS props instead.

As CSS changes can be hard to spot via automated testing etc, please give the preview site a good click around on, to my eyes it looks fairly identical to before this PR.


This PR is also a part experiment/bounce-around of AI.

The PR has 2 commits, one entirely generated by Claude/Opus4.6 and one with some tiny amends by me. I've included the prompts and plan that Claude created based off that and out of interest I asked it to record the time/tokens used in the frontmatter. Unfortunately this is only the time/tokens to generate the plan, I ran out of my session allowance just as Claude finished up its first pass (the first commit), and I was asking it to record the time/tokens for the implem. also. I guess I could have recorded this myself but I quit Claude and forgot to take a note of the time/tokens 🙈 .

As of right now I plan on deleting the plan before merge, I've left it in here seeing as this is the "modern source code" and we are an Open Source project. But as we haven't defined what we want to do here (if anything) I guess I'd probably delete it once we've reviewed this experiment.

Lastly, this PR still requires some review as I've already spotted one place where I think the colors have altered slightly, but all in all I think it looks pretty promising!

Oh I should add, Claude was running in a docker based sandbox with the project mounted inside along with an iptables based firewall. Be careful out there folks! 😅


Edit: I added another commit with a mostly AI generated README for XTheme (I asked it to take a look at the plan again), I made some fairly extensive edits to that myself and added a short README for x-icon-start also. 12% of my current session usage for writing the README 😱 .

Lastly I'm planning on deleting the plan from here, in fact I'll do it now, I'm guessing it will still be visible in the commits if folks are interested. edit: plan deleted taking out of Draft

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for kuma-gui ready!

Name Link
🔨 Latest commit 88e3ea2
🔍 Latest deploy log https://app.netlify.com/projects/kuma-gui/deploys/699884936aa18e0008f0ceb1
😎 Deploy Preview https://deploy-preview-4623--kuma-gui.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.

schogges
schogges previously approved these changes Feb 20, 2026
Copy link
Contributor

@schogges schogges left a comment

Choose a reason for hiding this comment

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

LGTM

There are a few left-over CSS rules that are not tokenized yet and could potentially be changed to use --x-<token> now, i.e.

Could be resolved in a follow-up or here.

@johncowen
Copy link
Contributor Author

Oh top spot 👏 , let me sort that here

Signed-off-by: John Cowen <john.cowen@konghq.com>
Assisted-by: Claude Code (Opus 4.6)
Signed-off-by: John Cowen <john.cowen@konghq.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
Signed-off-by: John Cowen <john.cowen@konghq.com>
@johncowen
Copy link
Contributor Author

Ok I made a couple of extra commits, one to sort the last non-tokenized colors:

  • I decided to pick a yellow from the kong/design-token for our warning icon even though its ever so slightly lighter than the one we had
  • I couldn't find a good kong/design-token gray for the highlight for our search 'tokens', so I made a component specific var and used the gray we were already using.

Apart from this, when looking at moving the --App* vars I also found that I could remove a load of fullscreen related things - so I went ahead and did that. I then moved the --App things to where they were being used, but kept the vars mainly for documentation purposes. So all in all a nice clean up!

Again just some observations from my AI usage here.

  • It totally missed the non-tokenized values we wouldn't have picked up on unless you'd spotted them. I guess maybe I didn't exactly specify this in the prompt (tbh I didn't even remember we had some of these) - but that being said if I'd done this as a human I would have spotted this myself I guess. Lucky you did a thorough review 👍
  • In going through this myself after the "good spot" I found I could do further valuable clean up to remove some code/complication, which wouldn't have happened otherwise I don't think 🤔

@johncowen johncowen requested a review from schogges February 20, 2026 16:06
Copy link
Contributor

@schogges schogges left a comment

Choose a reason for hiding this comment

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

Did you check x-components for variables and tokenization? I think there is at least this left
https://github.com/kumahq/kuma-gui/blob/master/packages/x/src/components/x-icon/XIcon.vue#L162-L166

<style lang="scss" scoped>
:deep(> *) {
& {
--x-anchor-text-color: #{$kui-color-text-primary};
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should use --x-color-text-primary here

Comment on lines 305 to 306
--icon-space-before: #{$kui-space-30};
--icon-space-after: #{$kui-space-30};
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should use --x-space-30 here

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.

2 participants