hence the comment about tracking ;) anything more than recording your events as they happen are a security and privacy risk
- 0 Posts
- 24 Comments
great example of a code smell, too! JS needs to know about styles?
shouldn’t be styling in JS! make it asd/remove a class instead
need to know whether to load content or not? save it to local/session storage! don’t make a server call if it already exists!
need to enhance your tracking? include it with your payloads as it happens, you’re asking for race conditions
client side disabled local caching? great! working as intended. make a graceful fall-back
everything here is a short term problem that belies long term tech debt. tight coupling sounds sexy, but SOLID principals and The Law of Demeter exist to stop our codebases from rotting if we can’t change it, then it’s not software it’s hardware
orockwell@lemmy.worldto Programming@programming.dev•how to create two switchable custom.scss in just-the-docs?2·2 months agoHELL YEAH! nice work 👏🏼
orockwell@lemmy.worldto Programming@programming.dev•how to create two switchable custom.scss in just-the-docs?2·3 months agoAlso 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
orockwell@lemmy.worldto Programming@programming.dev•how to create two switchable custom.scss in just-the-docs?2·3 months agoSorry, 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
orockwell@lemmy.worldto Programming@programming.dev•how to create two switchable custom.scss in just-the-docs?1·4 months agoYep! 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
orockwell@lemmy.worldto Programming@programming.dev•how to create two switchable custom.scss in just-the-docs?2·4 months agoTokenise 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 :)
orockwell@lemmy.worldto A Comm for Historymemes@lemmy.world•Union soldier sighting a canon. Gettysburg, July 2nd, 1863 (colorized)English101·7 months agoOh thank god, thats his daughter
This is incorrect and against the w3c spec. Use role=“presentation” or aria-hidden=“true” if it’s not needed
orockwell@lemmy.worldto Cassette Futurism@lemm.ee•Prototype of Yamaha Frog 750 by Hartmut Esslinger (1985)3·7 months agoMotorcycle, but yes absolutely.
Ask Will Toledo.
orockwell@lemmy.worldto Ask Lemmy@lemmy.world•Are UI layouts of video games subject to IP protection?11·8 months agoYes.*
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!
orockwell@lemmy.worldto Asklemmy@lemmy.ml•If you 'play' an operating system as if it was a game, what is the final boss, and how do you beat it?2·8 months agoLove this Insert Credit type question
orockwell@lemmy.worldto Asklemmy@lemmy.ml•What is your favorite extinction event, and why?10·9 months agoThe Holocene.
orockwell@lemmy.worldto Starfield@lemmy.zip•"Starfield's lead quest designer had 'absolutely no time' and had to hit the 'panic button' so the game would have a satisfying final quest"English4·1 year agoNote: the final paragraph contains spoilers for Starfield’s ending
unicorn literally means one horn how dare you mock this institution with your duocorn rhinoceros