Use Chained CSS Transforms to Position Elements
lessonDuration 2m 26sFree
In combination with scoped CSS variables, we can use chained CSS transforms to position elements. In this example, we lay out the lines for a Tic Tac Toe board.
Browse
Find courses, lessons, articles, talks, and podcasts.
53 resources
Showing 1–24 · Page 1 of 3
lessonDuration 2m 26sFree
In combination with scoped CSS variables, we can use chained CSS transforms to position elements. In this example, we lay out the lines for a Tic Tac Toe board.
lessonDuration 2m 8s
If you're applying delays to animation or using open-ended keyframes, fill mode will help with getting rid of flicker. Using animation-fill-mode, we can retain styling from animation keyframes. We can retain the styling during delay periods or even when the animation has completed.
lessonDuration 2m 26sFree
We can use selector combinations with the general sibling combinator to optionally show/hide elements using CSS. In this example, we look at detecting winning combinations for a Tic Tac Toe board.
lessonDuration 4m 19sFree
The power of CSS variable scope and randomly generated inline CSS variables makes for some interesting opportunities. In this lesson, we take a look at how combining them can give you the ability to generate random animations. I covered this for [CSS Tricks](https://css-tricks.com/the-power-and-fun-of-scope-with-css-custom-properties/).
lessonDuration 2m 10sFree
Using stroke-dashoffset and stroke-dasharray, we're able to make SVG strokes look as if they are drawn using CSS animation.
course
A collection of CSS tricks to tackle various problems.
lessonDuration 1m 59sFree
Use the HTML preprocessor Pug to generate markup for a form. Here we generate a set of labels and checkboxes. We link these using ES6 Template Literals with a loop index.
lessonDuration 3m 33sFree
It's the "Checkbox" hack! This is the key to how we can do things like making CSS toggles. Here, we look at using the :checked pseudo selector with the general sibling combinator to flip the turns of a Tic Tac Toe game.
lessonDuration 1m 36sFree
Using CSS variable scope we can stagger CSS animations to our choosing. For our Tic Tac Toe board, we want to stagger the animation of the grid lines in a way that makes it look hand drawn.
lessonDuration 1m 38sFree
Use CSS variables to take the responsibility of coloring SVG away from the markup in this example. Instead of an inline stroke, we can use scoped CSS variables to color the stroke for SVG elements.
lessonDuration 52sFree
Chaining CSS filters gives us the opportunity to create appealing visual effects. In this example, we look at creating a "neon" like effect for SVG.
lessonDuration 56sFree
We can use the :hover pseudo selector to conditionally style elements. In this example, we show how to do a show/hide for ghosting visual indicators on a tic tac toe board.
lessonDuration 48sFree
We can use the media query `prefers-reduced-motion` to detect a user's preference for motion. This is particularly useful when we have users that may have vestibular disorders. In these cases, we can detect it and set motion speed to zero.
course
Learn how to make a fully functioning Tic Tac Toe game that doesn't need any client-side JavaScript! For this course, we'll be using Pug and Stylus which are preprocessors for HTML and CSS respectively. Learn how to: - Generate markup with loops and template literals - Leverage native HTML behavior - Create SVG - Use CSS variables and scope - Implement game logic with HTML forms - Animate SVG with CSS - Use CSS Animation to provide motion - Use Pug Mixins - Disable motion when users don't want it - Apply visual effects using CSS filter and backdrop-filter - Generate random animations using Pug and CSS variables
lessonDuration 1m 5sFree
Using a backdrop filter gives us a way to blur out the backdrop of an element. This is particularly useful when we want to shift the focus from the background to the foreground.
lessonDuration 3m 12sFree
If you're repeating blocks of markup or code in Pug, you can use a mixin to reduce the maintenance overhead. Here, we look at some of the ways you can use Pug mixins.
lessonDuration 1m 6sFree
We can use SVG to create a cross with one path. But, what if want to animate a cross as if it's being hand-drawn? We can do this by defining more than one path for our SVG.
lessonDuration 1m 18sFree
Use the circle element in SVG to define a radius and center points for a circle.
lessonDuration 1m 56sFree
Use SVG to create lines with the path element. We can hand-code a path definition and set a stroke width and stroke linecap. We can adjust the path definition to accommodate for the SVG viewBox.
lessonDuration 1m 29sFree
The sibling combinators are a neat way to select elements that are siblings or descendants of siblings to checkboxes. It provides a way to show and hide elements without the need for JavaScript.
lessonDuration 2m 46sFree
By generating inline CSS variables with a markup preprocessor like Pug, we're able to generate CSS variables for positioning based on a loop index.
lessonDuration 1m 20sFree
Use display with the value grid to lay out items in a grid. You can specify the number of columns and rows using grid-template-columns and grid-template-rows.
lessonDuration 53sFree
You can use an element with the type "reset" within a form to reset a form on click. It's particularly useful when we don't want users to refresh a page in order to get back to an initial state.
lessonDuration 1m 36sFree
In this lesson, we look at how to read and write text to and from a users' clipboard. We can do this using the Clipboard API methods which return Promises. Check out [Browser Compatibility](https://caniuse.com/async-clipboard)