AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal
property.
HYBRID POSITIONING WITH CSS VARIABLES AND MAX() I.e., why not just do this: #toc { position: fixed; top: 11em; top: max(0em, 11rem - var(--scrolltop) * 1px); } The reason is that when you use CSS variables, this does not work as expected. The browser doesn’t know if your property value is valid until the variable is resolved, and by then it has already processed the cascade and has thrown
MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. BUBBLY — CSS SPEECH BUBBLES MADE EASY Bubbly CSS speech bubbles made easy! Side Top Right Bottom Left Pointer triangle Symmetrical Right Left Pointer size Use ems Background color
PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL! -prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
HYBRID POSITIONING WITH CSS VARIABLES AND MAX() I.e., why not just do this: #toc { position: fixed; top: 11em; top: max(0em, 11rem - var(--scrolltop) * 1px); } The reason is that when you use CSS variables, this does not work as expected. The browser doesn’t know if your property value is valid until the variable is resolved, and by then it has already processed the cascade and has thrown
MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. BUBBLY — CSS SPEECH BUBBLES MADE EASY Bubbly CSS speech bubbles made easy! Side Top Right Bottom Left Pointer triangle Symmetrical Right Left Pointer size Use ems Background color
PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL! -prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo HYBRID POSITIONING WITH CSS VARIABLES AND MAX() I.e., why not just do this: #toc { position: fixed; top: 11em; top: max(0em, 11rem - var(--scrolltop) * 1px); } The reason is that when you use CSS variables, this does not work as expected. The browser doesn’t know if your property value is valid until the variable is resolved, and by then it has already processed the cascade and has thrown
THE - -VAR: ; HACK TO TOGGLE MULTIPLE VALUES WITH ONE Limitations. I originally envisioned this as a building block for a technique horrible hack to enable “mixins” in the browser, since @apply is now defunct.However, the big limitation is that this only works for appending values to existing values — or setting a property to either a whole value or initial.There is no way to say “the background should be red if --foo is set and white THE CHROMA ZONE: ENGINEERING COLOR ON THE WEB The Chroma Zone: Engineering color on the Web. This slide deck was created for use in a controlled environment, during a talk. It works best with Firefox 28+ at 1280x720 or 1024x768 with enabled blending modes in about:config. It WILL NOT work properly in other browsers. The demos were live coded, so these slides are a bit pointless if you CSS CONIC-GRADIENT() POLYFILL CSS conic-gradient() polyfill. Conic gradients are awesome, but browsers haven’t realized yet. This polyfill lets you experiment with them now. If you like them, ask browser vendors to implement them! Editable Examples Community examples CSS VARIABLES: VAR(--SUBTITLE); CSS Variables in @keyframes? can even be transitioned or animated, but since the UA has no way to interpret their contents, they always use the "flips at 50%" behavior that is used for any other pair of values that can’t be intelligently interpolated. — CSS Custom Properties for Cascading Variables Module Level 1 CSS variables + animations = STYLING ELEMENTS BASED ON SIBLING COUNT Styling elements based on sibling count. The original idea belongs to André Luís, but I think it could be improved to be much less verbose. André’s solution is like this: It’s based on the relationship between :nth-child and :nth-last-child. As you can see, the number of total rules is O (N) and the number of selectors in every rule is
RESOLVE PROMISES EXTERNALLY WITH THIS ONE WEIRD TRICK Those of us who use promises heavily, have often wished there was a Promise.prototype.resolve() method, that would force an existing Promise to resolve. However, for architectural reasons (throw safety), there is no such thing and probably never will be. THE CURIOUS CASE OF BORDER-RADIUS:50% The curious case of border-radius:50%. Admittedly, percentages in border-radius are not one of the most common use cases. Some even consider them an edge case, since most people seem to set border-radius in pixels or –rarely– ems. And since it’s not used very frequently, it’s still quite buggy. IMAGE COMPARISON SLIDER WITH PURE CSS Image comparison slider with pure CSS. Post author By Lea Verou. Post date. July 25, 2014. 29 Comments. As a few of you know, I have been spending a good part of this year writing a book for O’Reilly called “CSS Secrets” ( preorder here! ). I wanted to include a “secret” about the various uses of the resize property, as it’s one of
INVERT A WHOLE WEBPAGE WITH CSS ONLY Invert a whole webpage with CSS only. Post author By Lea Verou. Post date. April 14, 2011. 24 Comments. I recently saw Paul Irish’s jQuery invert page plugin. It inverts every color on a webpage including images or CSS. This reminded me of the invert color keyword that’s allowed on outlines (and sadly only supported by Opera and IE9+).
AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
HYBRID POSITIONING WITH CSS VARIABLES AND MAX() I.e., why not just do this: #toc { position: fixed; top: 11em; top: max(0em, 11rem - var(--scrolltop) * 1px); } The reason is that when you use CSS variables, this does not work as expected. The browser doesn’t know if your property value is valid until the variable is resolved, and by then it has already processed the cascade and has thrown
MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. BUBBLY — CSS SPEECH BUBBLES MADE EASY Bubbly CSS speech bubbles made easy! Side Top Right Bottom Left Pointer triangle Symmetrical Right Left Pointer size Use ems Background color
PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL! -prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
HYBRID POSITIONING WITH CSS VARIABLES AND MAX() I.e., why not just do this: #toc { position: fixed; top: 11em; top: max(0em, 11rem - var(--scrolltop) * 1px); } The reason is that when you use CSS variables, this does not work as expected. The browser doesn’t know if your property value is valid until the variable is resolved, and by then it has already processed the cascade and has thrown
MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. BUBBLY — CSS SPEECH BUBBLES MADE EASY Bubbly CSS speech bubbles made easy! Side Top Right Bottom Left Pointer triangle Symmetrical Right Left Pointer size Use ems Background color
PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL! -prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo HYBRID POSITIONING WITH CSS VARIABLES AND MAX() I.e., why not just do this: #toc { position: fixed; top: 11em; top: max(0em, 11rem - var(--scrolltop) * 1px); } The reason is that when you use CSS variables, this does not work as expected. The browser doesn’t know if your property value is valid until the variable is resolved, and by then it has already processed the cascade and has thrown
THE - -VAR: ; HACK TO TOGGLE MULTIPLE VALUES WITH ONE Limitations. I originally envisioned this as a building block for a technique horrible hack to enable “mixins” in the browser, since @apply is now defunct.However, the big limitation is that this only works for appending values to existing values — or setting a property to either a whole value or initial.There is no way to say “the background should be red if --foo is set and white THE CHROMA ZONE: ENGINEERING COLOR ON THE WEB The Chroma Zone: Engineering color on the Web. This slide deck was created for use in a controlled environment, during a talk. It works best with Firefox 28+ at 1280x720 or 1024x768 with enabled blending modes in about:config. It WILL NOT work properly in other browsers. The demos were live coded, so these slides are a bit pointless if you CSS CONIC-GRADIENT() POLYFILL CSS conic-gradient() polyfill. Conic gradients are awesome, but browsers haven’t realized yet. This polyfill lets you experiment with them now. If you like them, ask browser vendors to implement them! Editable Examples Community examples CSS VARIABLES: VAR(--SUBTITLE); CSS Variables in @keyframes? can even be transitioned or animated, but since the UA has no way to interpret their contents, they always use the "flips at 50%" behavior that is used for any other pair of values that can’t be intelligently interpolated. — CSS Custom Properties for Cascading Variables Module Level 1 CSS variables + animations = STYLING ELEMENTS BASED ON SIBLING COUNT Styling elements based on sibling count. The original idea belongs to André Luís, but I think it could be improved to be much less verbose. André’s solution is like this: It’s based on the relationship between :nth-child and :nth-last-child. As you can see, the number of total rules is O (N) and the number of selectors in every rule is
RESOLVE PROMISES EXTERNALLY WITH THIS ONE WEIRD TRICK Those of us who use promises heavily, have often wished there was a Promise.prototype.resolve() method, that would force an existing Promise to resolve. However, for architectural reasons (throw safety), there is no such thing and probably never will be. THE CURIOUS CASE OF BORDER-RADIUS:50% The curious case of border-radius:50%. Admittedly, percentages in border-radius are not one of the most common use cases. Some even consider them an edge case, since most people seem to set border-radius in pixels or –rarely– ems. And since it’s not used very frequently, it’s still quite buggy. IMAGE COMPARISON SLIDER WITH PURE CSS Image comparison slider with pure CSS. Post author By Lea Verou. Post date. July 25, 2014. 29 Comments. As a few of you know, I have been spending a good part of this year writing a book for O’Reilly called “CSS Secrets” ( preorder here! ). I wanted to include a “secret” about the various uses of the resize property, as it’s one of
INVERT A WHOLE WEBPAGE WITH CSS ONLY Invert a whole webpage with CSS only. Post author By Lea Verou. Post date. April 14, 2011. 24 Comments. I recently saw Paul Irish’s jQuery invert page plugin. It inverts every color on a webpage including images or CSS. This reminded me of the invert color keyword that’s allowed on outlines (and sadly only supported by Opera and IE9+).
AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. BUBBLY — CSS SPEECH BUBBLES MADE EASY Bubbly CSS speech bubbles made easy! Side Top Right Bottom Left Pointer triangle Symmetrical Right Left Pointer size Use ems Background color
LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. PROJECTS – LEA VEROU Projects. Here you’ll find a list of tools, libraries, polyfills and other kinds of open source scripts I’ve developed over the years, ordered by release date, NOT popularity. Some ANIMATABLE: ONE PROPERTY, TWO VALUES, ENDLESS POSSIBILITIES Animatable One property, two values, endless possibilities Animate on hover Animate all
EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. BUBBLY — CSS SPEECH BUBBLES MADE EASY Bubbly CSS speech bubbles made easy! Side Top Right Bottom Left Pointer triangle Symmetrical Right Left Pointer size Use ems Background color
LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. PROJECTS – LEA VEROU Projects. Here you’ll find a list of tools, libraries, polyfills and other kinds of open source scripts I’ve developed over the years, ordered by release date, NOT popularity. Some ANIMATABLE: ONE PROPERTY, TWO VALUES, ENDLESS POSSIBILITIES Animatable One property, two values, endless possibilities Animate on hover Animate all
EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. THE - -VAR: ; HACK TO TOGGLE MULTIPLE VALUES WITH ONE Limitations. I originally envisioned this as a building block for a technique horrible hack to enable “mixins” in the browser, since @apply is now defunct.However, the big limitation is that this only works for appending values to existing values — or setting a property to either a whole value or initial.There is no way to say “the background should be red if --foo is set and white MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. IMPORT NON-ESM LIBRARIES IN ES MODULES, WITH CLIENT-SIDE There is a syntax to import a module entirely for its side effects: import "url/to/library.js"; This syntax works fine for libraries that use globals, since declaring a global is essentially a side effect, and all modules share the same global scope. For this to work, the imported library needs to satisfy the following conditions: ABOUT ME – LEA VEROU About me. My name is Lea Verou (Lea being short for Michailia or Μιχαήλια) and I wear many hats. My day job is researching how to make web programming easier at MIT CSAIL, working with David Karger in the Haystack group. I have a long-standing passion for open web standards. I’m an elected W3C Technical Architecture Group (TAG) member
ANIMATABLE: ONE PROPERTY, TWO VALUES, ENDLESS POSSIBILITIES Animatable One property, two values, endless possibilities Animate on hover Animate all
PROJECTS – LEA VEROU Projects. Here you’ll find a list of tools, libraries, polyfills and other kinds of open source scripts I’ve developed over the years, ordered by release date, NOT popularity. Some UTILITY: CONVERT SVG PATH TO ALL-RELATIVE OR You just paste your path in a textarea and it both displays it and instantly converts it to all-relative and all-absolute paths (also using Snap.svg). It also displays both your original path and the two converted ones, so you can make sure they still look the same. It even follows a pending-delete pattern so you can just focus on the output THE CHROMA ZONE: ENGINEERING COLOR ON THE WEB The Chroma Zone: Engineering color on the Web. This slide deck was created for use in a controlled environment, during a talk. It works best with Firefox 28+ at 1280x720 or 1024x768 with enabled blending modes in about:config. It WILL NOT work properly in other browsers. The demos were live coded, so these slides are a bit pointless if you PARSEL: A TINY, PERMISSIVE CSS SELECTOR PARSER Usage. Parsel is an ES module. You import it like so: import * as parsel from "https://projects.verou.me/parsel/parsel.js" Note that to use that your script needs to STRONGLYTYPED: A LIBRARY FOR STRONGLY TYPED PROPERTIES I’ll start by saying I love the loosely typed nature of JavaScript. When I had to work with strongly typed languages like Java, it always seemed like an unnecessary hassle. On the contrary, my boyfriend even though very proficient with HTML, CSS and SVG, comes from a strong Java background and hates loosely typed scripting languages. AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. BUBBLY — CSS SPEECH BUBBLES MADE EASY Bubbly CSS speech bubbles made easy! Side Top Right Bottom Left Pointer triangle Symmetrical Right Left Pointer size Use ems Background color
LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL! -prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. IMPORT NON-ESM LIBRARIES IN ES MODULES, WITH CLIENT-SIDE There is a syntax to import a module entirely for its side effects: import "url/to/library.js"; This syntax works fine for libraries that use globals, since declaring a global is essentially a side effect, and all modules share the same global scope. For this to work, the imported library needs to satisfy the following conditions: EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo UTILITY: CONVERT SVG PATH TO ALL-RELATIVE OR You just paste your path in a textarea and it both displays it and instantly converts it to all-relative and all-absolute paths (also using Snap.svg). It also displays both your original path and the two converted ones, so you can make sure they still look the same. It even follows a pending-delete pattern so you can just focus on the output AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. BUBBLY — CSS SPEECH BUBBLES MADE EASY Bubbly CSS speech bubbles made easy! Side Top Right Bottom Left Pointer triangle Symmetrical Right Left Pointer size Use ems Background color
LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL! -prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. IMPORT NON-ESM LIBRARIES IN ES MODULES, WITH CLIENT-SIDE There is a syntax to import a module entirely for its side effects: import "url/to/library.js"; This syntax works fine for libraries that use globals, since declaring a global is essentially a side effect, and all modules share the same global scope. For this to work, the imported library needs to satisfy the following conditions: EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo UTILITY: CONVERT SVG PATH TO ALL-RELATIVE OR You just paste your path in a textarea and it both displays it and instantly converts it to all-relative and all-absolute paths (also using Snap.svg). It also displays both your original path and the two converted ones, so you can make sure they still look the same. It even follows a pending-delete pattern so you can just focus on the output LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
THE - -VAR: ; HACK TO TOGGLE MULTIPLE VALUES WITH ONE Limitations. I originally envisioned this as a building block for a technique horrible hack to enable “mixins” in the browser, since @apply is now defunct.However, the big limitation is that this only works for appending values to existing values — or setting a property to either a whole value or initial.There is no way to say “the background should be red if --foo is set and white MULTIRANGE: A TINY POLYFILL FOR HTML5 MULTI-HANDLE SLIDERS. multirange. A tiny polyfill for HTML5 multi-handle sliders. Download JS Download CSS Features. Only 0.6KB minified & gzipped! No dependencies. Uses feature detection, will not run if two-handle sliders are natively supported. IMPORT NON-ESM LIBRARIES IN ES MODULES, WITH CLIENT-SIDE There is a syntax to import a module entirely for its side effects: import "url/to/library.js"; This syntax works fine for libraries that use globals, since declaring a global is essentially a side effect, and all modules share the same global scope. For this to work, the imported library needs to satisfy the following conditions: ABOUT ME – LEA VEROU About me. My name is Lea Verou (Lea being short for Michailia or Μιχαήλια) and I wear many hats. My day job is researching how to make web programming easier at MIT CSAIL, working with David Karger in the Haystack group. I have a long-standing passion for open web standards. I’m an elected W3C Technical Architecture Group (TAG) member
PROJECTS – LEA VEROU Projects. Here you’ll find a list of tools, libraries, polyfills and other kinds of open source scripts I’ve developed over the years, ordered by release date, NOT popularity. Some UTILITY: CONVERT SVG PATH TO ALL-RELATIVE OR You just paste your path in a textarea and it both displays it and instantly converts it to all-relative and all-absolute paths (also using Snap.svg). It also displays both your original path and the two converted ones, so you can make sure they still look the same. It even follows a pending-delete pattern so you can just focus on the output CHECKERBOARD PATTERN WITH CSS3 A while ago, I wrote a post on creating simple patterns with CSS3 gradients.A common pattern I was unable to create was that of a regular, non-rotated checkerboard. However, I noticed today that by giving a different background-position to every triangle in the pattern tile, a
CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. STRONGLYTYPED: A LIBRARY FOR STRONGLY TYPED PROPERTIES I’ll start by saying I love the loosely typed nature of JavaScript. When I had to work with strongly typed languages like Java, it always seemed like an unnecessary hassle. On the contrary, my boyfriend even though very proficient with HTML, CSS and SVG, comes from a strong Java background and hates loosely typed scripting languages. AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. ABOUT ME – LEA VEROU About me. My name is Lea Verou (Lea being short for Michailia or Μιχαήλια) and I wear many hats. My day job is researching how to make web programming easier at MIT CSAIL, working with David Karger in the Haystack group. I have a long-standing passion for open web standards. I’m an elected W3C Technical Architecture Group (TAG) member
PROJECTS – LEA VEROU Projects. Here you’ll find a list of tools, libraries, polyfills and other kinds of open source scripts I’ve developed over the years, ordered by release date, NOT popularity. Some PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL! -prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. STRONGLYTYPED: A LIBRARY FOR STRONGLY TYPED PROPERTIES I’ll start by saying I love the loosely typed nature of JavaScript. When I had to work with strongly typed languages like Java, it always seemed like an unnecessary hassle. On the contrary, my boyfriend even though very proficient with HTML, CSS and SVG, comes from a strong Java background and hates loosely typed scripting languages. AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
LCH COLORS IN CSS: WHAT, WHY, AND HOW? LCH is a color space that has several advantages over the RGB/HSL colors we’re familiar with in CSS. In fact, I’d go as far as to call it a game-changer, and here’s why. 1. We actually get access to about 50% more colors. This is huge. Currently, every CSS color we can specify, is defined to be in the sRGB color space. ABOUT ME – LEA VEROU About me. My name is Lea Verou (Lea being short for Michailia or Μιχαήλια) and I wear many hats. My day job is researching how to make web programming easier at MIT CSAIL, working with David Karger in the Haystack group. I have a long-standing passion for open web standards. I’m an elected W3C Technical Architecture Group (TAG) member
PROJECTS – LEA VEROU Projects. Here you’ll find a list of tools, libraries, polyfills and other kinds of open source scripts I’ve developed over the years, ordered by release date, NOT popularity. Some PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL! -prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. STRONGLYTYPED: A LIBRARY FOR STRONGLY TYPED PROPERTIES I’ll start by saying I love the loosely typed nature of JavaScript. When I had to work with strongly typed languages like Java, it always seemed like an unnecessary hassle. On the contrary, my boyfriend even though very proficient with HTML, CSS and SVG, comes from a strong Java background and hates loosely typed scripting languages. HYBRID POSITIONING WITH CSS VARIABLES AND MAX() I.e., why not just do this: #toc { position: fixed; top: 11em; top: max(0em, 11rem - var(--scrolltop) * 1px); } The reason is that when you use CSS variables, this does not work as expected. The browser doesn’t know if your property value is valid until the variable is resolved, and by then it has already processed the cascade and has thrown
THE CHROMA ZONE: ENGINEERING COLOR ON THE WEB The Chroma Zone: Engineering color on the Web. This slide deck was created for use in a controlled environment, during a talk. It works best with Firefox 28+ at 1280x720 or 1024x768 with enabled blending modes in about:config. It WILL NOT work properly in other browsers. The demos were live coded, so these slides are a bit pointless if you STRETCHY: FORM ELEMENT AUTOSIZING, THE WAY IT SHOULD BE. Features. Handles multiple types of form controls Textareas? Inputs? Select menus? You name it! Tiny footprint Less than 1.5KB minified and gzipped!; Automatically accounts for newly added controls via mutation observers, where supported; Restrict form controls by a selector or don’t and autosize all your form controls!; Completely standalone no jQuery or other dependencies IMPORT NON-ESM LIBRARIES IN ES MODULES, WITH CLIENT-SIDE There is a syntax to import a module entirely for its side effects: import "url/to/library.js"; This syntax works fine for libraries that use globals, since declaring a global is essentially a side effect, and all modules share the same global scope. For this to work, the imported library needs to satisfy the following conditions: CSS3 PATTERNS GALLERY AND A NEW PATTERN CSS3 patterns gallery and a new pattern. I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. Here it is: Also, it includes a brand new pattern, which is the hardest one I have ever made so far: Japanese cubes. CHECKERBOARD PATTERN WITH CSS3 A while ago, I wrote a post on creating simple patterns with CSS3 gradients.A common pattern I was unable to create was that of a regular, non-rotated checkerboard. However, I noticed today that by giving a different background-position to every triangle in the pattern tile, a
STRONGLYTYPED: A LIBRARY FOR STRONGLY TYPED PROPERTIES I’ll start by saying I love the loosely typed nature of JavaScript. When I had to work with strongly typed languages like Java, it always seemed like an unnecessary hassle. On the contrary, my boyfriend even though very proficient with HTML, CSS and SVG, comes from a strong Java background and hates loosely typed scripting languages. PURE CSS SCROLLING SHADOWS WITH BACKGROUND-ATTACHMENT A few days ago, the incredibly talented Roman Komarov posted an experiment of his with pure CSS “scrolling shadows”.If you’re using Google Reader, you are probably familiar with the effect: In Roman’s experiment, he is using absolutely positioned pseudoelements to cover the shadows (which are basically radial gradients as background images), taking advantage of the fact that when you GET YOUR HASH
The approach I usually use is far simpler than both of the above and probably looks too loose: var hash = location.hash.substring (1); However, let’s examine it a bit: With our weird test hash, it actually returns the correct result: “foo@o#bar$%huh hello”. When no hash exists, it correctly returns the empty string. CONVERT STANDARD GRADIENT SYNTAX TO -WEBKIT-GRADIENT AND I hate -webkit-gradient() with a passion. Its syntax is cumbersome and it’s really limited: No angle support, no s in color stop positions, no implied color stop AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? I was always interested in color science. In 2014, I gave a talk about CSS Color 4 at various conferences around the world called “The Chroma Zone”.Even before that, in 2009, I wrote a color picker that used a hidden Java applet to support ICC color profiles to do CMYK properly, a first on the Web at the time (to my knowledge). LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
PROJECTS – LEA VEROU Here you’ll find a list of tools, libraries, polyfills and other kinds of open source scripts I’ve developed over the years, ordered by release date, NOT popularity.Some of them only work in recent browsers.
ABOUT ME – LEA VEROU Lea Verou front-end web developer and designer currently living in Greece όπως μας λέει μέσα απο το About της. Εξαιρετικό design στο WordPress blog της και πολύ προσεγμένο. PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL!JQUERY CHANGE CSSJQUERY CSS IMPORTANTJQUERY CSS POSITIONJQUERY CSS STYLEJQUERY SET CSS
-prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo CSS3 PATTERNS GALLERY AND A NEW PATTERN I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. STRONGLYTYPED: A LIBRARY FOR STRONGLY TYPED PROPERTIESSTATICALLY TYPED VS STRONGLY TYPED
I’ll start by saying I love the loosely typed nature of JavaScript. When I had to work with strongly typed languages like Java, it always seemed like an unnecessary hassle. On the contrary, my boyfriend even though very proficient with HTML, CSS and SVG, comes from a strong Java background and hates loosely typed scripting languages. AWESOMPLETE: ULTRA LIGHTWEIGHT, HIGHLY CUSTOMIZABLE Awesomplete 2KB minified & gzipped!. Ultra lightweight, customizable, simple autocomplete widget with zero dependencies, built with modern standards for modern browsers.Because still doesn’t cut it.. Demo (no JS, minimal options) CSS3 PATTERNS GALLERY Click on a pattern to expand; Textareas are editable; Browser support; Submit a new one; Github repo; Enjoy! Browser support. The patterns themselves should work on Firefox 3.6+, Chrome, Safari 5.1, Opera 11.10+ and IE10+.However, implementation limitations might cause some of them to not be displayed correctly even on those browsers (for example at the time of writing, Gecko is quite buggy LCH COLORS IN CSS: WHAT, WHY, AND HOW? I was always interested in color science. In 2014, I gave a talk about CSS Color 4 at various conferences around the world called “The Chroma Zone”.Even before that, in 2009, I wrote a color picker that used a hidden Java applet to support ICC color profiles to do CMYK properly, a first on the Web at the time (to my knowledge). LEA VEROU – LIFE AT THE BLEEDING EDGE (OF WEB STANDARDS) Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit. A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it’s explicitly set, in which case it functions like a normal property.
PROJECTS – LEA VEROU Here you’ll find a list of tools, libraries, polyfills and other kinds of open source scripts I’ve developed over the years, ordered by release date, NOT popularity.Some of them only work in recent browsers.
ABOUT ME – LEA VEROU Lea Verou front-end web developer and designer currently living in Greece όπως μας λέει μέσα απο το About της. Εξαιρετικό design στο WordPress blog της και πολύ προσεγμένο. PREFIX FREE: BREAK FREE FROM CSS VENDOR PREFIX HELL!JQUERY CHANGE CSSJQUERY CSS IMPORTANTJQUERY CSS POSITIONJQUERY CSS STYLEJQUERY SET CSS
-prefix-free Break free from CSS prefix hell! Only 2KB gzipped-prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed. EVEN MORE CSS SECRETS SVGs with no viewBox spread to cover the entire area. Strokes stay the same width. We can use this to apply fancy SVG strokes to our HTML elements! 4 Line Headings. width: 100% on h1, height on pseudo CSS3 PATTERNS GALLERY AND A NEW PATTERN I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. STRONGLYTYPED: A LIBRARY FOR STRONGLY TYPED PROPERTIESSTATICALLY TYPED VS STRONGLY TYPED
I’ll start by saying I love the loosely typed nature of JavaScript. When I had to work with strongly typed languages like Java, it always seemed like an unnecessary hassle. On the contrary, my boyfriend even though very proficient with HTML, CSS and SVG, comes from a strong Java background and hates loosely typed scripting languages. HYBRID POSITIONING WITH CSS VARIABLES AND MAX() Notice how the navigation on the left behaves wrt scrolling: It’s like absolute at first that becomes fixed once the header scrolls out of the viewport.
STRETCHY: FORM ELEMENT AUTOSIZING, THE WAY IT SHOULD BE. Features. Handles multiple types of form controls Textareas? Inputs? Select menus? You name it! Tiny footprint Less than 1.5KB minified and gzipped!; Automatically accounts for newly added controls via mutation observers, where supported; Restrict form controls by a selector or don’t and autosize all your form controls!; Completely standalone no jQuery or other dependencies THE CHROMA ZONE: ENGINEERING COLOR ON THE WEB Important This slide deck was created for use in a controlled environment, during a talk. It works best with Firefox 28+ at 1280x720 or 1024x768 with enabled blending modes in about:config. IMPORT NON-ESM LIBRARIES IN ES MODULES, WITH CLIENT-SIDE In case you haven’t heard, ECMAScript modules (ESM) are now supported everywhere! While I do have some gripes with them, it’s too late for any of these things to change, so I’m embracing the good parts and have cautiously started using them in new projects.I do quite like that I can just use import statements and dynamic import() for dependencies with URLs right from my JS, without CSS3 PATTERNS GALLERY AND A NEW PATTERN I finally got around to doing what I wanted to do for quite a few months: Create a gallery with all the basic patterns I was able to create with CSS3 gradients. STRONGLYTYPED: A LIBRARY FOR STRONGLY TYPED PROPERTIES I’ll start by saying I love the loosely typed nature of JavaScript. When I had to work with strongly typed languages like Java, it always seemed like an unnecessary hassle. On the contrary, my boyfriend even though very proficient with HTML, CSS and SVG, comes from a strong Java background and hates loosely typed scripting languages. CHECKERBOARD PATTERN WITH CSS3 A while ago, I wrote a post on creating simple patterns with CSS3 gradients.A common pattern I was unable to create was that of a regular, non-rotated checkerboard. However, I noticed today that by giving a different background-position to every triangle in the pattern tile, a
PURE CSS SCROLLING SHADOWS WITH BACKGROUND-ATTACHMENT A few days ago, the incredibly talented Roman Komarov posted an experiment of his with pure CSS “scrolling shadows”.If you’re using Google Reader, you are probably familiar with the effect: In Roman’s experiment, he is using absolutely positioned pseudoelements to cover the shadows (which are basically radial gradients as background images), taking advantage of the fact that when you CONVERT STANDARD GRADIENT SYNTAX TO -WEBKIT-GRADIENT AND I hate -webkit-gradient() with a passion. Its syntax is cumbersome and it’s really limited: No angle support, no s in color stop positions, no implied color stop GET YOUR HASH
This is probably one of the things that everyone thinks they know how to do but many end up doing it wrong. After coming accross yet one more super fragile snippet of Skip to the content
Search
Lea Verou
Life at the bleeding edge (of web standards) Menu * Projects
* Speaking
* Publications
* Press
* Interviews
* About
Search
Search for: Close search Close Menu
*
Projects
*
Speaking
*
Publications
*
Press
*
Interviews
*
About
* @leaverou on Twitter * GitHub
* LinkedIn
* Dribbble
* CodePen
Categories
Rants
IS THE CURRENT TAB ACTIVE? * Post author By Lea Verou * Post date May 24, 2021 * 4 Comments
Today I ran into an interesting problem. Interesting because it’s one of those very straightforward, deceptively simple questions, that after a fair amount of digging, does not appear to have a definite answer (though I would love to be wrong!). The problem was to determine IF THE CURRENT TAB IS ACTIVE. Yes, as simple as that.
Continue reading “Is the current tab active?” ------------------------- Categories
Uncategorized
82% OF DEVELOPERS GET THIS 3 LINE CSS QUIZ WRONG * Post author By Lea Verou * Post date May 21, 2021 * 2 Comments
(_I always wanted to do a clickbait title like this and when this chance came along I could not pass it up. Sorry!_) While putting my ideas into slides for my Dynamic CSS workshop for
next week, I was working on a slide explaining how the CSS wide keywords work with custom properties. inherit, initial, unset I had used numerous times and knew well. But what about revert ? How did
that work? I had an idea, but quickly coded up a demo to try it out. The code was:
:root {
--accent-color: skyblue; }
div {
--accent-color: revert; background: var(--accent-color, orange); }
Phew, I was correct, but the amount of uncertainty I had before seeing the result tipped me that I might be on to something. Before you read on, take a moment to think about what you would vote. Warning: Spoilers ahead! Continue reading “82% of developers get this 3 line CSS quiz wrong”
------------------------- Categories
Articles Original
Tutorials
DARK MODE IN 5 MINUTES, WITH INVERTED LIGHTNESS VARIABLES * Post author By Lea Verou * Post date March 30, 2021 * 7 Comments
By now, you probably know that you can use custom properties for individual color components, to avoid repeating the same color coordinates multiple times throughout your theme. You may even know that you can use the same variable for multiple components, e.g. HSL hue and lightness:
:root {
--primary-hs: 250 30%; }
h1 {
color: hsl(var(--primary-hs) 30%); }
article {
background: hsl(var(--primary-hs) 90%); }
article h2 {
background: hsl(var(--primary-hs) 40%); color: white;
}
Here is a very simple page designed with this technque :
CodePen Embed Fallback Unlike preprocessor variables, you could even locally override the variable, to have blocks with a different accent color :
:root {
--primary-hs: 250 30%; --secondary-hs: 190 40%; }
article {
background: hsl(var(--primary-hs) 90%); }
article.alt {
--primary-hs: var(--secondary-hs); }
CodePen Embed Fallback This is all fine and dandy, until dark mode comes into play. The idea of using custom properties to make it easier to adapt a theme to dark mode is not new. However, in every
article
I
have
seen
,
the strategy suggested is to create a bunch of custom properties, one for each color, and override them in a media query. This is a fine approach, and you’ll likely want to do that for at least part of your colors eventually. However, even in the most disciplined of designs, not every color is a CSS variable. You often have colors declared inline, especially grays (e.g. the footer color in our example). This means that adding a dark mode is taxing enough that you may put it off for later, especially on side projects. The trick I’m going to show you will make anyone who knows enough about color cringe (sorry Chris!) but it does help you create a dark mode that _works_ in minutes. It won’t be great, and you should eventually tweak it to create a proper dark mode (also dark mode is not just about swapping colors )
but it’s better than nothing and can serve as a base. Continue reading “Dark mode in 5 minutes, with inverted lightness variables”
* Tags CSS variables , dark mode , hsl
, lch
------------------------- Categories
Articles
MASS FUNCTION OVERLOADING: WHY AND HOW? * Post author By Lea Verou * Post date February 10, 2021 * 5 Comments
One of the things I’ve been doing for the past few months (on and off—more off than on TBH) is rewriting Bliss to use ESM
1. Since Bliss v1 was not using a modular architecture at all, this introduced some interesting challenges. Continue reading “Mass function overloading: why and how?” * Tags API Design , Bliss , esm
, JavaScript
, JS
------------------------- Categories
Tutorials
WRITABLE GETTERS
* Post author By Lea Verou * Post date December 23, 2020 * 2 Comments
Setters removing themselves are reminiscent of Ouroboros , the serpent eating its own tail, an ancient symbol. Media credit A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties _unless_ it’s explicitly set, in which case it functions like a normal property. Essentially, the expression functions as a default value. Continue reading “Writable getters” * Tags Accessors , ECMAScript , JavaScript
, JS
, JS Patterns
------------------------- Categories
Personal
POSITION STATEMENT FOR THE 2020 W3C TAG ELECTION * Post author By Lea Verou * Post date November 30, 2020 UPDATE: I got elected!! Thank you so much to every W3C member organization who voted for me. Now on to making the Web better, alongside fellow TAG members!
_CONTEXT: I’m running for one of the four open seats in this year’s W3C TAG election . The W3C Technical
Architecture Group (TAG) is the Working Group that ensures that Web Platform technologies are usable and follow consistent design principles, whether they are created inside or outside W3C. It advocates for the needs of everyone who uses the Web and everyone who works on the Web. If you work for a company that is a W3C Member , please consider
encouraging your AC rep to vote for me! My candidate statement follows._
Continue reading “Position Statement for the 2020 W3C TAG Election”
* Tags standards , W3C ------------------------- Categories
Articles
THE CASE FOR WEAK DEPENDENCIES IN JS * Post author By Lea Verou * Post date November 19, 2020 * 12 Comments
Earlier today, I was briefly entertaining the idea of writing a library to wrap and enhance querySelectorAll in certain ways. I thought I’d rather not introduce a Parsel dependency out of the box, but only use it to parse selectors properly when it’s available, and use more crude regex when it’s not (which would cover most use cases for what I wanted to do).
In the olden days, where every library introduced a global, I could just do:
if (window.Parsel) { let ast = Parsel.parse(); // rewrite selector properly, with AST }
else {
// crude regex replace }
However, with ESM, there doesn’t seem to be a way to detect whether a module is imported, without actually importing it yourself. I tweeted
about this…
Continue reading “The case for Weak Dependencies in JS” * Tags esm , JS
, software engineering ------------------------- Categories
Tips
SIMPLE PIE CHARTS WITH FALLBACK, TODAY * Post author By Lea Verou * Post date November 12, 2020 * 14 Comments
Five years ago, I had written this extensive Smashing Magazine article detailing multiple different methods for creating simple pie charts, either with clever use of transforms and pseudo-elements, or with SVG stroke-dasharray. In the end, I mentioned creating pie charts with conic gradients, as a future technique. It was actually a writeup of my “The Missing Slice” talk ,
and an excerpt of my CSS Secrets book ,
which had just been published. I was reminded of this article today by someone on Twitter: I suggested conic gradients, since they are now supported in >87% of users’ browsers , but he needed to support IE11. He suggested using my polyfill from back then, but this is not a very good idea today. Indeed, unless you _really_ need to display conic gradients, even I would not recommend using the polyfill on a production facing site. It requires -prefix-free , which re-fetches (albeit from cache) your entire CSS and sticks it in a