
Logical Operations with CSS Custom Properties
9/17/19About 2 minCSSArticle(s)blogbram.uscss
Logical Operations with CSS Custom Properties êŽë š
CSS > Article(s)
Article(s)
Logical Operations with CSS Custom Properties
Going beyond Binary Conditions for CSS Calculations, Ana Tudor takes it to a whole new level by introducing the logical operations (and, or, nand, nor, not, and xor) to CSS â all built on top of calc() Very often, while using switch variables, I wish I could perform logical operations on them. We donât have ⊠Continue reading âLogical Operations with CSS Custom Propertiesâ

Going beyond Binary Conditions for CSS Calculations, Ana Tudor takes it to a whole new level by introducing the logical operations (and, or, nand, nor, not, and xor) to CSS â all built on top of calc()
Very often, while using switch variables, I wish I could perform logical operations on them. We donât have functions like
not(var(--i))orand(var(--i), var(--k))in CSS, but we can emulate these and more with arithmetic operations in acalc()function.
Impressive!
Logical Operations with CSS Variables
Very often, while using switch variables (a variable that's either 0 or 1, a concept that's explained in a greater detail in in this post), I wish I could
âïž FYI
Theyâre officially called âCSS Custom Propertiesâ, not âCSS Variablesâ đ
Logical Operations with CSS Custom Properties
Going beyond Binary Conditions for CSS Calculations, Ana Tudor takes it to a whole new level by introducing the logical operations (and, or, nand, nor, not, and xor) to CSS â all built on top of calc() Very often, while using switch variables, I wish I could perform logical operations on them. We donât have ⊠Continue reading âLogical Operations with CSS Custom Propertiesâ