orockwell

joined 2 years ago
[โ€“] [email protected] 2 points 1 month ago

Also worth noting media queries for specific use cases, like dark mode or high contrast: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme

[โ€“] [email protected] 2 points 1 month ago

Sorry, just saw your reply. Great question! That's the beauty of a variable. If they're all supposed to use the same values, then it's one place to control them, one place to update them. Single Responsibility Principal! ๐Ÿ˜Ž

That means you won't run into the bug of updating it in one place, but forgetting /not knowing to update it in another.

It's also where tokens (ie: 2-layered variables) shine. All links should use the accent colour. Single variable for that high level concept, but each theme can specify what the low level concept should be (eg: theme 1 uses your design system's green-bright)

And if that concept's concretion (ie: actual / raw value) needs to change (eg: the green is now a different shade), it's still only one place that needs to change

It also helps identify what areas use the same concept (eg: how many use the accent colour) and opportunities to combine/ deduplicate

[โ€“] [email protected] 1 points 1 month ago (2 children)

Yep! This pattern will work on any website. You only need to be able to write CSS, and apply a class to the body tag.

AFAIK Jekyll uses Liquid for template flow control - you could set the class; or even load specific CSS that way too

[โ€“] [email protected] 2 points 1 month ago* (last edited 1 month ago) (4 children)

Tokenise your styles with variable layers. Eg: put a class on your body tag for each theme, eg: dark-mode, high-contrast

Then define your components by abstract style variables, eg: button-color, heading-weight,

Then define the style variables for each theme:

body { --button-color: green; }

body.dark-mode { --button-color: blue; }

button { backgroud: var(--button-color); }

Then all you need to do is a simple JS function to set the appropriate theme class on your document body!

This way your components are compliant to your style guide, without needing to know the implementation details of your themeing Very SRP, much Demeter, such OCP

Apologies for psudocode, LMK if you have any furthers :)

[โ€“] [email protected] 9 points 4 months ago

Oh thank god, thats his daughter

[โ€“] [email protected] 5 points 4 months ago
[โ€“] [email protected] 3 points 4 months ago

Motorcycle, but yes absolutely.

[โ€“] [email protected] 5 points 5 months ago

Ask Will Toledo.

[โ€“] [email protected] 11 points 5 months ago* (last edited 5 months ago)

Yes.*

You can patent a design pattern, within a specific context (provided the patent is approved)

NAMCO infamously patented 'Loaing Screen Games', with its documented example being Galaga.

Thankfully that patent expired in 2015. Hope this answers your question!

[โ€“] [email protected] 2 points 6 months ago

Love this Insert Credit type question

[โ€“] [email protected] 10 points 6 months ago (3 children)
view more: next โ€บ