As part of the Full Site Editing FSEhttps://developer.wordpress.org/block-editor/getting-started/full-site-editing/ experience, templates and page templates give you a way to prepackage blocks similar to what variations do and full-page templates for the theme. Templates and page templates currently require the Gutenberg pluginhttps://wordpress.org/plugins/gutenberg/ and will not run in WordPress Core right now, that will change sometime during the 5.9 development cycle. To understand the block template and block template parts work let's look at the structure of a block-based theme. text . ├── LICENSE ├── README.md ├── assets │ ├── css │ ├── images │ └── js ├── block-template-parts │ ├── footer.html │...
Now that WordPress 5.9 is close to release, we can revisit the Gutenberg full site editing experience since more of it will be baked into core rather than the Gutenberg plugin. I'm not a fan of full site editing just like I'm not completely sold on Gutenberg as an editor even after a few years. But, since the market is moving in this direction, I believe that developers should be aware of Gutenberg and the FSE to provide guidance on the optimal approach to the client's project. I've been reading and researching the latest improvements to the FSE experience and...
The other side of the argument is that we've let the web become boring. We've lost the whimsical designs from the early days. Examples like the Space Jam website, from 1996, show what earlier websites looked like: !Space Jam website, circa 1996https://res.cloudinary.com/dfh6ihzvj/image/upload/cscale,w500/fauto,qauto/space-jam-website As much as some of us hated it, tables for layout had their use : Dave Ellis' All Websites Look The Samehttp://www.novolume.co.uk/blog/all-websites-look-the-same/ and Sarah Drasner's In Defense of a Fussy Websitehttps://css-tricks.com/in-defense-of-a-fussy-website/ ask two different but related topics: the sameness of our websites and the need for some level of whimsy on the websites we build. It doesn't have...
Doing web development used to be simple. All we needed was a text editor and either good knowledge of HTML, CSS, and Javascript or bookmarks on your browser pointing to Eric Meyer’s CSS resources on the CWRU server and links to the best tutorials you could find about CSS and Javascript with the differences for each browser and how to branch the code to accommodate each browser’s idiosyncracies. Those days are long gone. Reading David Rupert’s The tangled webs we weavehttps://daverupert.com/2020/09/tangled-webs/ reflected some of my own struggles when working with existing projects. But even when working on our projects, starting...
I've told myself for a while that I would learn how to write and use tests for front-end code. Most of the code and tutorials I've seen are written for backend code. But using tools like Playwrighthttps://playwright.dev/ together with Mochahttps://mochajs.org/ and the Chaihttps://www.chaijs.com/ assertion library we can build very robust testing for front end code that works in multiple browsers. Background: Playwright Playwright is Microsoft's browser testing and automation library. It allows you to control a browser: Chrome, Firefox, or Safari WebKit and perform operations as if you were working on the browser directly. Because we support multiple browsers we...
In Do you know where your third parties are going?https://publishing-project.rivendellweb.net/do-you-know-where-your-third-parties-are-going/ we discussed part of the problem: How to measure the additional impact these scripts have on our site's performance when they add more scripts that may block rendering? This post will cover some additional concerns I have with third-party scripts. We need to evaluate third-party libraries for use in our applications. This doesn't mean to only look at the code and decide which one you like best but it also means to test the code in your application and see which library or script works best in your specific situation....
The idea of a performance budget is to set the performance goals for the site. What is a performance budget? There are multiple definitions of what's a performance budget. According to Performance budgets 101https://web.dev/performance-budgets-101/: > A performance budget is a set of limits imposed on metrics that affect site performance. This could be the total size of a page, the time it takes to load on a mobile network, or even the number of HTTP requests that are sent. From Performance Budgets That Stickhttps://timkadlec.com/remembers/2019-03-07-performance-budgets-that-stick/: > A performance budget is a clearly defined limit on one or more performance metrics that...
now that CSS Grid has become better supported in all major browsers, it is time to look at some of the more whimscal layouts that are possible. This post will look at the following areas: Positioning elements in a grid Combining grids and flexboxes Area templates All items should work in all browsers. According to caniuse.com, CSS Grid is supported in all major browsers. The basic grids We will use the following grids: 12 equal columns and compound 4x6. Both grids will have equal rows of 200px and will have 1em gap between columns and rows. The 12 column grid...
A while back I wrote about color.jshttps://publishing-project.rivendellweb.net/color-js-a-css-color-tool-in-javascript/ a color manipulation library by Lea Verou. Chroma.jshttps://gka.github.io/chroma.js/ is another color manipulation library that allows you to manipulate colors in a natural way without using preprocessors. The post will look at the basics of Chroma.js, we'll create a series of colors to exercise the library, and then we'll convert them into Custom Properties that we can use from CSS. Chroma.js The first thing I discovered when playing with Chroma was how to work with different color spaces and how to convert from one color space to another. color.hexmode='auto|rgb|rgba' The first thing that called...
Two new proposals to import non-Javascript resources in Javascript modules are reaching stage 3 in the TC39 process, meaning that implementations are already available or will be available soon. This post will take a first look at these features and how they can be used in a project. JSON Modules Json modules allow you to import JSON files and use them in your javascript modules. With the following configuration file config.json json { "name": "My Application", "version": "v1.2" } We can import and use it from a sample JSON module as shown below. js import http from 'http'; import config...