catppuccin / github

🐈‍⬛ Soothing pastel theme for GitHub
MIT License
251 stars 21 forks source link

Use regex to avoid styling actions marketplace #32

Closed rbutera closed 2 years ago

rbutera commented 2 years ago

github actions marketplace is light-mode only for now.

I think it will see a lot of styling updates in the near future, so there is no point touching it for now until the stock stylesheet schema becomes more stable.

This change simply enables the catppuccin/github theme on any non-marketplace github url.

unseen-ninja commented 2 years ago

I may be misinterpreting something here, but the goal is to not apply the theme on github.com/marketplace, right? In taht case this rule has two issues: It doesn't match the gists anymore, and it still applies the theme to the marketplace as this gets caught by the regex as true. o:

regex in action

rbutera commented 2 years ago

@andreasgrafen you are indeed misinterpreting something, the regex is escaped in a different format than that which works in regexr. Regex is double escaped when you put it in CSS strings. It can be very confusing to work with, which is why Stylus lets you type in single-escaped regex patterns in the box and it will automatically convert them to the appropriate css regex pattern.

2022-10-11-164840- Github Catppuccin (Rai) - Stylus

I have marketplace open in this window as well, unfortunately I can't show that.

(i had a typo in my original regex (was using \d not \w to detect subdomains, brainfart, but that's now been fixed)

unseen-ninja commented 2 years ago

Ah, okay. That makes more sense then. Thanks for the explanation. c: It now also successfully styles Gists as well; tho we don't want to style every sub domain as discussed in #14. This rule currently also requires the / to be present for the marketplace, which might not always be the case. Could this just be left out? With those changes the correct regex should be https://(gist\.)*github.com(?!/marketplace).*, right?

rbutera commented 2 years ago

ok. i've limited it to just the gists subdomain. LGTM now?????