Dublin Library

The Publishing project

Exploring Intrinsic Sizing

There are two ways to measure content in CSS. Explicit measurements are what we're most familiar with. These are the pixels, rems and ems. Intrinsic sizes don't provide exact dimensions but size elements based on their content. This post will cover these intrinsic, content-based, measurement units min-content The min-content value is the intrinsic minimum width, which means that it’s equal to the width of the element’s content longest word. According to the CSS Working Group: > The inline size that would fit around its contents if all soft wrap opportunities within the box were taken. See the Pen min-content and...

Continue reading →

Writing Modes, Direction and Text-Orientation

The Writing Modeshttps://drafts.csswg.org/css-writing-modes-3/ specification reached full recommendation status almost 5 years ago. I've written about it before but I think it's time to revisit them again and see how they could be applied to design. The three specific areas we'll cover in this post are: directionhttps://www.w3.org/TR/css-writing-modes-3/direction writing-directionhttps://www.w3.org/TR/css-writing-modes-3/block-flow text-orientationhttps://www.w3.org/TR/css-writing-modes-3/text-orientation Direction The directionhttps://developer.mozilla.org/en-US/docs/Web/CSS/direction CSS property is a complement to the HTML dirhttps://developer.mozilla.org/en-US/docs/Web/HTML/Globalattributes/dir attribute. It allows you to set the global value of when used in the root element and change when used in children elements the direction of the text on the page. The two possible values are ltr for left to...

Continue reading →

Everything is a box

One way of thinking about HTML and web content is to think about boxes, multiple boxes surrounding your content. You can see these nested boxes in your browser's Dev Tools as shown in figure 1. !CSS Box Modelhttps://res.cloudinary.com/dfh6ihzvj/images/v1698731828/publishing-project.rivendellweb.net/box-model-2/box-model-2.png?i=AA Starting from the inside, the boxes are: content box : The area that the content lives in. : If the box-sizinghttps://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing property is set to content-box and the element is a block element, the content area's size can be explicitly defined with the following properties: : widthhttps://developer.mozilla.org/en-US/docs/Web/CSS/width : min-widthhttps://developer.mozilla.org/en-US/docs/Web/CSS/min-width : max-widthhttps://developer.mozilla.org/en-US/docs/Web/CSS/max-width : heighthttps://developer.mozilla.org/en-US/docs/Web/CSS/height : min-heighthttps://developer.mozilla.org/en-US/docs/Web/CSS/min-height : max-heighthttps://developer.mozilla.org/en-US/docs/Web/CSS/max-height padding box : surrounds the...

Continue reading →

Shapes as Layout Drivers

CSS Shapeshttps://developer.mozilla.org/en-US/docs/Web/CSS/CSSshapes have been around for a long time and allow developers to wrap text around the shape of the image. According to MDNhttps://developer.mozilla.org/en-US/docs/Web/CSS/CSSshapes: > The CSS shapes module describes geometric shapes that can be in CSS. For the Level 1 specification, CSS shapes can be applied to floating elements. The specification defines a number of different ways to define a shape on a floated element, causing wrapping lines to wrap round the shape rather than following the rectangle of the element's box. Basic Examples The most basic example uses an image to create the shape that the text flows...

Continue reading →

Revisiting Images For The Web

It's been a while since I've looked at image formats supported on web browsers. The last time I did, AVIF had recently been introduced and Apple had announced support for WebP in Safari and operating systems. At the time we also had Squooshhttps://squoosh.app/ as a command line application that could be incorporated directly into Gulp build systems. The baseline for this post is a series of posts I wrote in 2020: Revisiting Image Formats for the Webhttps://publishing-project.rivendellweb.net/revisiting-images-formats-for-the-web/ and Image Formats for the Web: HEIC and AVIFhttps://publishing-project.rivendellweb.net/image-formats-for-the-web-heic-and-avif/ But times change. Squoosh CLI is no longer maintained by the Chrome team due...

Continue reading →

Creating an Eleventy Website (Part 2)

In the last post, we looked at building and configuring an Eleventy website. This post will look at creating content for the site including: Migrating old content from WordPress, creating additional templates, creating partials, creating short codes and other types of Eleventy content. Expanding the work We created a default template for the application and have a working site. There is more we can do and we'll explore some of these areas. Creating Additional Templates We can have multiple templates for different layout designs. Using this strategy we can inline CSS specific to a theme and set up the correct...

Continue reading →

Creating an Eleventy Website (Part 1)

I used WordPress until 2023 when I became disappointed as to the direction the project was going and how much harder blocks make it to create bespoke designs the way I'm used to. So I decided to move to Eleventyhttps://www.11ty.dev/ because most of the sites I build are static and have no server-rendered components. My first project was to move my web technology blog to Eleventy. There are still some issues I have to address, like auto-posting to Twitter/X when new posts are published but, on average, it has been really good. So now I'm thinking of a new project...

Continue reading →

Compiling Go Programs

In all previous Go-related posts, we've just run the code using Go's run command, like so: bash go run main.go But there are times when we must compile the program either for internal use or to share with third parties. This post will describe how to run programs without compiling them, how to compile programs in Go, how to give them a name, how to cross-compile to support multiple platforms, and how to run the resulting binaries. Running the code To run the code execute the following command on the root directory of the project bash go run main.go Compiling...

Continue reading →

Using Third-Party Libraries in Go

So far we've covered command-line applications that only use modules in the standard library This post will explore using third-party modules by building a conversion tool from Markdown to HTML Before We Start: Initializing Go Modules bash go mod init github.com/caraya/markdown-converter Then, whenever we want to install a third-party package, we run the following command bash go get For example: bash go get github.com/BurntSushi/toml or bash go get go.abhg.dev/goldmark/frontmatter We'll point out what packages to get when it's appropriate. First Iteration: Building the Conversion Tool In the first step, I'm trying to understand how to get the Markdown parser to...

Continue reading →

Opening and Writing Files With Go

In the last post, we looked at how to build an API server using Go. In this post, we'll look at one part of building command line applications: how to open and write files. We'll also cover related areas like reading input from the command line and how to get user input and act on that input. In the next post, we'll look at how to use third-party libraries in Go programs by building a Markdown conversion tool. The first iteration: the basics The first attempt is very simple. It does the following: 1. Opens a specific file that has...

Continue reading →