Dublin Library

The Publishing project

Creating A CSS Reset

CSS Resets have been around for a while and they have evolved along with CSS and browser support. The notion of a CSS reset first came around with undoHTML.css by Tantek Celik in 2004 and it does what it says; it undoes many of the CSS defaults in browsers so you have a clean beginning for your own work. css :link,:visited { text-decoration:none } ul,ol { list-style:none } h1,h2,h3,h4,h5,h6,pre,code { font-size:1em; } ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p, blockquote,fieldset,input { margin:0; padding:0 } a img,:link img,:visited img { border:none } address { font-style:normal } In 2005, Farouk Ates created initial.csshttp://web.archive.org/web/20050930205005/http:/kurafire.net/log/archive/2005/07/26/starting-css-revisited as groupings of styles that...

Continue reading →

When To Use @property

Custom properties are awesome. They provide modularity and a central place to store variables that we'll use throughout a stylesheet. But they are not perfect. This post will discuss two ways to define CSS Custom properties and when it's best to use each type. Defining CSS Custom Properties CSS Custom Properties also known as CSS Variables are defined in CSS Custom Properties for Cascading Variables Module Level 1https://www.w3.org/TR/css-variables-1/. They are commonly used to provide a central locatin for values used multiple times throughout the document. Before variables we would have to change each individual instance of the value would be...

Continue reading →

Design Brainstorm: Moments

One of my current projects is to create a journaling system similar to Hihttps://hitotoki.org/ did. The idea is described in Full stack writing and publishing: Welcome to Hihttps://hitotoki.org/moments/q4oi5i68. The Idea The idea of this application is as follows: Mobile first application Users log into the platform and have the option to read what other people have written or create their content. Log in Use Google and Facebook login Capture initial data Capture a summary or sketch of the post Capture the location where the post originated using the Geolocation API Use a Geocoding service to get the location and display...

Continue reading →

Multipage View Transitions

When initially introduced, view transitions would only work with single-page applications. This is awesome but it doesn't work with regular web pages like what I normally work with. During I/O 2024, Bramus introduced extensions to the Page View API that would make them work across pages on the same origin. This will create more appealing transitions between pages in an application. How they work Note:"> Cross-document view transitions are limited to same-origin navigations only. Navigation is considered to be same-origin if the origin of both participating pages is the same. To have a cross-document view transition between two documents, both...

Continue reading →

Exclusive Accordions

Accordions present an interesting way to display content using one or more detailshttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/details elements. There is a specific type of accordion that, until recently, was impossible to do without scripting, the exclusive accordion. This post will explain what's an exclusive accordion and how to polyfill the API to handle older browsers. What are exclusive accordions and how they work To achieve this on the web you can now a name attribute to details elements. When this attribute is used, all details elements with the same name value form a semantic group and will behave as an exclusive accordion. When you...

Continue reading →

Playing with Relative Color Syntax

Now that relative colors are supported across browsers it's time to revisit the syntax and see what we can do with it and how it changes what we can natively do with colors. Basic Syntax The most basic syntax for relative colors has the following shape: 1. The color space you want to work on, in the example: OKLCH 2. The color that we want to work from, using the from keyword and the color that we want to use, in this case, 663399 3. The channels for the target format, in this case, l for lightness, c for chrome,...

Continue reading →

The Anchor Positioning API

A complementary API to Popovers is the anchor positioning APIhttps://developer.chrome.com/blog/anchor-positioning-api Where the popover attribute controls the popover behavior, the anchor positioning allows us to control where will the popover appear. We've already covered popovers so this post will look at the anchor positioning API and how it interacts with popovers. Non-popover The most basic use of the anchor is to place content positioned relative to the anchor point. These anchor points can be any HTML element. In the example below, we use an anchor use a div element as the anchor and a second div as the content to be...

Continue reading →

Responsive Videos ftw

Ever since we've had responsive images we've been able to add media queries to control the conditions that will trigger a match for a specific child element. But we haven't been able to do the same thing with videos. We have to make a good guess and hope that the videos we send down the wire are small enough that they won't slow down user experiences on mobile or consume large chunks of a user's data plan. The first example uses two source elements: The first one will match windows smaller than 599px The second one will match otherwise and...

Continue reading →

What Are Duotones And How They Work

Duotone is a graphic design technique that makes for contrasting graphics that can be combined with text and other CSS effects. This post will look at what are duotone colors and how to create duotone colors in CSS to use with images. How To Create Duotone Colors in CSS? The CSS portion of the process consists of three layers: A base layer layer1 with a background image grayscale and brightness CSS filters Two 2 layers layer2 and layer3 Each with a background color and mix-blend-modehttps://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode to blend the layer with the other layers css .layer { position: absolute; width: 100%;...

Continue reading →

What Is Baseline?

If you use web.dev or MDN, you may have seen blocks indicating baseline availability like those in Figures 1 and 2. !Baseline message as shown on web.devhttps://res.cloudinary.com/dfh6ihzvj/image/upload/v1717014095/webdev-baselinev0be1b.png !Baseline message as it appears on MDNhttps://res.cloudinary.com/dfh6ihzvj/image/upload/v1717014095/mdn-baselineolvxqk.png So what does this mean? Web Platform Baseline baseline provides clear information about browser support for web platform features. It gives developers clear information about which web platform features are ready to use in your projects today. The core browsers used to determine baseline support are: Chrome desktop and Android Edge Firefox desktop and Android Safari macOS and iOS There are two stages of feature baseline...

Continue reading →