MDN self-hosted library · e01.org

`sign()` CSS function

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

css
/* property: sign( expression ) */
top: sign(20vh - 100px);
css
div {
  background-position: calc(sign(10%) * 1px);
}
css
div {
  position: absolute;
  top: calc(100px * sign(var(--value)));
}