Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The HTML and CSS Workshop

You're reading from   The HTML and CSS Workshop Learn to build your own websites and kickstart your career as a web designer or developer

Arrow left icon
Product type Paperback
Published in Nov 2019
Publisher Packt
ISBN-13 9781838824532
Length 700 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (4):
Arrow left icon
Matt Park Matt Park
Author Profile Icon Matt Park
Matt Park
Brett Jephson Brett Jephson
Author Profile Icon Brett Jephson
Brett Jephson
Marian Zburlea Marian Zburlea
Author Profile Icon Marian Zburlea
Marian Zburlea
Lewis Coulson Lewis Coulson
Author Profile Icon Lewis Coulson
Lewis Coulson
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Introduction to HTML and CSS FREE CHAPTER 2. Structure and Layout 3. Text and Typography 4. Forms 5. Themes, Colors, and Polish 6. Responsive Web Design and Media Queries 7. Media – Audio, Video, and Canvas 8. Animations 9. Accessibility 10. Preprocessors and Tooling 11. Maintainable CSS 12. Web Components 13. The Future of HTML and CSS Appendix

CSS Paint API

The first API from CSS Houdini to see the light of day, with an actual browser implementation, is the Paint API, which first appeared in Chrome 65 and is now available in Opera with the intent for Firefox, Safari, and Edge to implement it as well.

The Paint API gives us a way to control a 2D rendering context that we can programmatically draw to using JavaScript. This is a lot like the Canvas element we learned about in Chapter 7, Media – Audio, Video, and Canvas.

There are a couple of significant differences between the Paint API and the 2D rendering context of the Canvas:

  • The main difference is that the Paint API allows us to use the 2D image with any CSS property that accepts an image as a value. For example, we can create a 2D image and then use it as the value for a background-image, border-image, or mask-image.
  • The Paint API also makes use of a worklet, which is a bit like a worker, that is, a thread running parallel to the main browser...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image