Dublin Library

The Publishing project

Checking web compatibility

When working with web content, it is important to check what browsers your content is compatible with. There are three ways to do this: Web UI caniusehttps://caniuse.com provides a basic compatibility table for most major desktop and mobile browsers. MDNhttps://developer.mozilla.org/ goes a step further than Caniuse, it also provides additional information about the property, how it works and the specification that the property belongs to. Both Caniuse and MDN require you to have a browser open on the right site and actively search for the property or API you're looking for. Programmatic Tools MDN provides its browser compatibility datahttps://www.npmjs.com/package/@mdn/browser-compat-data as...

Continue reading →

Playing with relative color syntax in CSS

Relative color syntaxhttps://www.w3.org/TR/css-color-5/relative-colors gives developers a lot of power to control the colors we use in our pages. In this post I will base the examples on code from CSS relative color syntaxhttps://developer.chrome.com/blog/css-relative-color-syntax/ by Adam Argylehttps://twitter.com/argyleink. I will try to keep it simple, if you want more details check Adam's article, it goes into a lot of detail on how to use the syntax to do a lot of things. Basic syntax and the from keyword at the most basic, the structure of the syntax is as follows 1. The color space for the resulting color 2. The from keyword...

Continue reading →

OKLCH as my new deafult color space

CSS Colors Level 4https://www.w3.org/TR/css-color-4/ introduced new syntactic sugar to color functions. It also added 14 different color spaces and ways to define colors. The one thca caught my attention is the OKLCH color space. In oklchL C H or oklchL C H / a each item corresponds as follows: L is perceived lightness 0%-100%. “Perceived” means that it has consistent lightness for our eyes, unlike L in hsl. C is chroma, from gray to the most saturated color. H is the hue angle 0-360. a is alpha or opacity 0-1 or 0-100%. css p { color: oklch0.31 0.2 265 /...

Continue reading →

Fixing Issues With Pre-formatted Inline Text

While researching about using resets as the basis for custom project defaults, I came accross this solution to a problem I was having. > pre, code, kbd, samp The font-family: monospace, monospace hack fixes the inheritance and scaling of font-size for preformatted text. The duplication of monospace is intentional. Source. > > Source: Normalize.css READMEhttps://github.com/necolas/normalize.cssreadme To me, this became evident when using code elements inside a header. If the element that contains the code element is sized using em the different in font size is obvious. However, if you size the element using rem the change doesn't appear to happen...

Continue reading →

Migrating from WordPress to Eleventy (part 4)

There are more areas I'm working on as I move from WordPress to Eleventy that, in my opinion, are easier to do with a static site generator. There is still more to work on as I've officially moved the site, I will continue to post in this series as I finish the other pieces of content. Identifying links to the Wayback Machine There are times when the site I link to has been removed, has moved behind a paywall or has become unreachable. Most of the time I will just remove the link but there are situations where the content...

Continue reading →

Migrating from WordPress to Eleventy (part 3)

These are more random, miscelaneous, items that I'm working on to make the site look as close as possible to the WordPress version of the site. Implement Archive Pagination The way I want the blog structured, the index page only has the last 10 published posts and a link to the archive. In the first iteration, I want the archive to be paginated on 10-item blocks. yaml --- layout: layouts/home.njk pagination: data: collections.posts size: 10 reverse: true permalink: "{% if pagination.pageNumber > 0 %}page-{{ pagination.pageNumber }}/{% endif %}index.html" --- The content of the post itself doesn't change. It remains the...

Continue reading →

Temporal is about to reach stage 4

People who have been waiting for the Temporal proposal, and for browsers to release their implementations unprefixed, have reason to be happy : IETF has approved draft-ietf-sedate-datetime-extendedhttps://datatracker.ietf.org/doc/draft-ietf-sedate-datetime-extended/, which was the last block before moving Temporal to stage 4 in the TC-39 processhttps://tc39.es/process-document/. Now, short of major implementation issues reported to TC39, this should move to stage 4 once two interoperable implementations ship in browsers. Using the Temporal polyfillhttps://www.npmjs.com/package/temporal-polyfill provides a spec-compliant workaround for the API until browsers implement it natively. I discussed using the polyfill along with examples of how the API works in Revisiting the TC39 Temporal proposal/revisiting-the-tc39-temporal-proposal/

Continue reading →

PostCSS plugins I want to look at

Since I decided to move to a PostCSS workflow from SASS, there are a few other plugins that I want to look at to consider adding them to the workflow. I'm not 100% sure that any of these plugins will make it to the PostCSS process. I'm documenting them here to keep a record of what the thought process was. Management: These plugins will control behavior and results of using PostCSS postcss-nestedhttps://github.com/postcss/postcss-nested will cover nesting until we can be certain that all browsers can handle nesting postcss-sortinghttps://github.com/hudochenkov/postcss-sorting sorts the properties in a rule postcss-easy-importhttps://github.com/TrySound/postcss-easy-import inlines the content of imported files...

Continue reading →

Migrating from WordPress to Eleventy (part 2)

Once I got a basic migration working how I want to, I can look at details that go beyond content and deal with styling and layout. Typography And Other CSS Work As much work as I've done in typography to make the Eleventy site look like the WordPress version, there is work still to do. Typography The first thing to do is to create a more apealing typograhical experience. I created a major third typographical scale using Type Scalehttps://typescale.com/. I increased the base font size slightly from 1.125 to 1.25 to make the text easier to read. We first define...

Continue reading →

Migrating from WordPress to Eleventy

For a while I've been thinking about moving my blog out of WordPress and into a static site. There are a number of reasons why I want to do this but the main one relates to the block editor The block editor makes it harder for me to create custom content the way that I want to do it. Rather than use blocks, I prefer to use HTML and CSS to create layouts. With every new release, WordPress becomes more block-oriented and less acommodating to other design and development patterns. You have to use plugins to re-enable the traditional editor...

Continue reading →