Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Lego2012/2374777e7601595e0d3cf252355491b0 to your computer and use it in GitHub Desktop.
Save Lego2012/2374777e7601595e0d3cf252355491b0 to your computer and use it in GitHub Desktop.

Use case #1:

Your client has once again sent you logos that don't meet your requirements (different sizes, sometimes lack transparency, etc.).

Just use the following CSS hack for these logos:

.logo {
	width: 50%;
	aspect-ratio: 3/2;
	object-fit: contain;
	/* to remove e.g. a white background */
	mix-blend-mode: color-burn;
}

Use case #2:

A plugin uses inline styles but has no classes, but you want to change this one paragraph.

Did you know that you can use a style attribute of a paragraph as a selector?

/* Example: */

<p style="color: #111;"> testing </p>

/* Selector: */

p[style="color: #111;"] {
	color: red !important;
}

Not something you should do, but it's still interesting :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment