Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Last active April 24, 2024 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeaVerou/7d15728036b6008f0fa7acf4a275adad to your computer and use it in GitHub Desktop.
Save LeaVerou/7d15728036b6008f0fa7acf4a275adad to your computer and use it in GitHub Desktop.
none-containing values as intermediate stops
/**
* none-containing values as intermediate stops
*/
div:nth-of-type(1) {
background: linear-gradient(to right in oklch, oklch(80% 0.1 0), oklch(80% 0.1 170));
}
div:nth-of-type(2) {
background: linear-gradient(to right in oklch, oklch(80% 0.1 0), oklch(50% none none), oklch(80% 0.1 170));
}
div:nth-of-type(3) {
background: linear-gradient(to right in oklch, oklch(80% 0.1 0), oklch(50% 0.1 calc((0 + 170) / 2)), oklch(80% 0.1 170));
}
/* Demo styling */
div {
padding: 1em;
flex: 1;
}
body {
padding: 2em;
display: flex;
flex-flow: column;
gap: 1em;
height: 100vh;
}
* {
margin: 0;
box-sizing: border-box;
}
<p>Without none:
<div></div>
<p>With an intermediate <code>oklch(50% none none)</code> stop:
<div></div>
<p>Was this the expectation?
<div></div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment