Image Optimisation
<symbol> and <use> layout difference
<symbol>
tags within an svg
tag and without? e.g.
```html
<svg>...icon swap | InnerHTML security risks
innerHTML
to a different svg. I’ve heard this poses security risks though since users can manipulate the data in there. What would a better alternative be for swapping out content like that?Using
adjacentHTML
doesn’t seem like it would fit the use case since this adds the content but doesn’t replace it. I know you could then remove the other icon but I feel you could do the whole thing in one swoop without doing that? I may be wrong. I believe there was a method called .replaceWith
or something along those lines but I’d assume you would put html in there too so I’d imagine there’s security risks with that as well, and I can’t imagine using a template for something small like this is worth it? Please correct me if I’m wrong with any of this.
...JS Date Picker in <dialog>
skip eggs function
``` // My code starts here. function noFuckingEggs(array) { let emptyArray = [];...
svg width and height attribute + resizing
width
and height
attributes e.g. <svg width="x" height="y">...</svg>
and size them using css. Then i realised that if the css doesn't load, they're massive haha. so i keep those attributes now.
One thing i've noticed about resizing them with css when they have those attributes, is that they only resize when you define the width and the height e.g.
```css
svg {...CSS – managing grid-template-columns sizes with classes
padding
on demand without altering the vertical text/content position.
While layouting with grid
, the idea is to have a nice (padding)class, that adds to the element area but keeping the content in line.
It is very likely possible to fake with before/after
, but that always feels last-resort-ish to me....Sidebar sidebar like explorer
Two Column Layout, but the other one goes to edge.
Cursor Pointer on transparent image
how can i achieve this section ?
How to make varying labels width and input-fields take same horizontal space
how to center a <div> ?
pollyfill definition
Help with a CSS selector that targets all elements that have "aria-*" attributes
how is it absolute position is outside of the doc structure yet still i'm getting this composition
Best practice for forcing text to wrap onto new line on a specific word
<h2 className="text-2xl sm:text-4xl text-center sm:text-left mb-6 font-bold drop-shadow-[3px_3px_0px_hsl(0,0%,82%)] "> Lorem ipsum dolor sit,...
Trying to understand the concept when callbacks are passed as arguments
How to prevent an array storing items from local storage from initializing each time
Text that fills the width of a container