The :any-linkhttps://developer.mozilla.org/en-US/docs/Web/CSS/:any-link styles all a elements with an href attribute. This allows us to target all links in a document, regardless of location or parents. This is particularly useful when playing with text-decoration- attributes. Safari uses the -webkit- prefix for these properties so we need to duplicate work to ensure that the links display the same across browsers. css :any-link { border: 1px solid blue; color: orange; } / WebKit browsers / :-webkit-any-link { border: 1px solid blue; color: orange; } We can also add link pseudo-elements like :hover and :visited to the :any-link selector. css :any-link { border: 1px...
CSS provides ways to play with the underline of elements beyond removing the underline from links and only showing it on hover. CSS Text Decoration Module Level 4https://drafts.csswg.org/css-text-decor-4/ provides four longhand properties one shorthand property for underlining text. This post will cover the text-decoration- properties and some adjacent properties: The text-decoration-skip- properties text-underline-position text-underline-offset We will also discuss When to Avoid the text-decoration Shorthand Propertyhttps://css-tricks.com/when-to-avoid-css-text-decoration-shorthand/. Using the shorthand property is nice as it saves typing but it's not always the best option. The post explains when and why it may be a good idea to use the longhand properties. text-decoration-\:...
One very frustrating thing when working with images on the web is when you're trying to fit an image into a container. If the image has different dimensions and aspect ratio than the container, the image will be resized to fit, losing potentially important portions of the image or stretching it to the point it becomes blurry and hard to find the details on it. This post will discuss three attributes that may help solve this type of problem: object-fit, background-size and aspect-ratio. Background Before we start there are a couple of background items to talk about. Replaced Elements In...
Introduction I use Codelabs to document processes and step-by-step instructions for given processes or topics. However, unlike tools for authoring codelabs, there is no real way to author a codelabs website that is not heavily geared towards Google Codelabs and its websitehttps://codelabs.developers.google.com/ which uses Google infrastructure and resources that may not be needed for codelabs hosted elsewhere. Rather than try to work around Google's Codelab website tools, I decided to build my own website to host Codelabs. The Idea The idea for the website is to: Create a JSON file with information about the codelabs Build a website Insert the...
A lot of times when I try a new front-end technology or decide to work with a new framework, I need a backend to work with. For the longest time, I've used a project database hosted locally but I've decided to use a different strategy and build a single REST API backed by a MongoDB database. With an API I can then concentrate on the front end and use an existing CRUD Create, Read, Update, Delete REST API. The following table shows the different parts of the proposed API: | HTTP Verb | Endpoint | Description | | --- |...
It's been a while since I've looked at WebAssembly and Go. Some things have changed since then and I want to document them as I revisit them. Some of these changes deal with the evolution of Go as a programming language, some of them deal with Go's support for Webassmebly, and some have dealt with the evolution of WebAssembly. First project: Building a template Before we start looking at specific projects, let's look at what we need to do to compile Go to WebAssembly. The first step is to initialize the project from GO. We do this by running the...
In a previous posthttps://publishing-project.rivendellweb.net/new-gutenberg-features-block-and-global-configuration/ I briefly discussed how to configure blocks and themes using JSON files. The emphasis of that post was on theme configuration and briefly mentioned block.json in passing as a way to configure individual blocks. This post will dive deeper into block.json as a block configuration tool and how to use the configuration data in the code of the plugin we create. bash npx @wordpress/create-block notice \ --namespace rivendellweb The command will produce the following scaffolding in the notice directory. It will also install @wordpress/scripts as part of the installation process. I've removed the content of nodemodules...
This is a place to document issues I'm finding as I build my theme. A lot of these issues may be caused by my lack of experience with Gutenberg and the way the full site editor works. I will file issues about these items in the Gutenberg repo where I feel it's necessary. Adjusting Expectations One of the things I'm not sure works as intended or that I'm not understanding correctly is how the full site editor works. If I'm understanding this correctly, the changes on the editor should be reflected in the corresponding file I'm editing and vice-versa, right?...
Gutenberg gives you the tools to do pagination visually but, unfortunately, I haven't found a way to customize the pagination tool so that it works the way I want to. There are two different types of pagination in a WordPress-based blog: One for index and archive pages and one for individual posts. Index Page Navigation The pagination layout I ended up using on my site looks like this: html There are some issues with the default navigation. If there is no previous or next post, the remaining content will move. I would rather is remain static and the space be...
Gutenberg presents an interesting way to create and use design systems and present them to the user. I use the following definition of a design system: > A design system is a complete set of standards intended to manage design at scale using reusable components and patterns. > > Design Systems 101https://www.nngroup.com/articles/design-systems-101/ — Nielsen Norman Group I wrote a series of posts on the topic of using Gutenberg as a design system and variations of those design items. Gutenberg as a design system Part 1https://publishing-project.rivendellweb.net/gutenberg-as-a-design-system-part-1/ Part 2https://publishing-project.rivendellweb.net/gutenberg-as-design-systems-part-2/ Part 3https://publishing-project.rivendellweb.net/gutenberg-as-design-systems-part-3/ This post is a review and further exploration of Gutenberg-based design...