Doing It Wrong

learn in public

Site Navigation

  • Home
  • Books
  • Work & Play

Site Search

You are here: Home / 2023 / Archives for November 2023

Archives for November 2023

Git Submodules

posted on November 27, 2023

Oft-used, never understood.

References

  • Git SCM
  • man git-submodule

Add a Submodule

git submodule add <URL>

This creates a .gitmodules file that shows the mapping between your project and its submodules.

Clone with Submodules

  1. clone your project as normal
  2. git submodule init to initialize from .gitmodules
  3. git submodule update to fetch data from the commit referenced at the other end of the .gitmodules repo URL

Filed Under: Development Tagged With: git

Quotes

posted on November 27, 2023

Quotes that Resonate

Today I have grown taller from walking with the tree. —Karle Wilson Baker

Brevity is the soul of wit, but clarity is the soul of evolvable software. —Martin Fowler

I like orderly confusion very much. But this is neither orderly nor properly confused. —Dieter Rams

Less but better. —Dieter Rams

Filed Under: Development Tagged With: Quotes

The Cascade Algorithm

posted on November 27, 2023

Four Stages of the Cascade Algorithm

The cascade algorithm is split into 4 distinct stages.

  1. Position and order of appearance: the order of which your CSS rules appear
  2. Specificity: an algorithm which determines which CSS selector has the strongest match
  3. Origin: the order of when CSS appears and where it comes from, whether that is a browser style, CSS from a browser extension, or your authored CSS
  4. Importance: some CSS rules are weighted more heavily than others, especially with the !important rule type

Order of Specificity for Origins

  1. User agent base styles. These are the styles that your browser applies to HTML elements by default.
  2. Local user styles. These can come from the operating system level, such as a base font size, or a preference of reduced motion. They can also come from browser extensions, such as a browser extension that allows a user to write their own custom CSS for a webpage.
  3. Authored CSS. The CSS that you author.
  4. Authored !important. Any !important that you add to your authored declarations.
  5. Local user styles !important. Any !important that come from the operating system level, or browser extension level CSS.
  6. User agent !important. Any !important that are defined in the default CSS, provided by the browser.

Order of Importance

  1. normal rule type, such as font-size, background or color
  2. animation rule type
  3. !important rule type (following the same order as origin)
  4. transition rule type

Filed Under: Development Tagged With: CSS

  • « Previous Page
  • 1
  • 2
  • 3
  • Next Page »

Profile Links

  • GitHub
  • Buy Me a Coffee?

Recent Posts

  • Event Listeners
  • A Philosophy of Software Design
  • The Programmer’s Brain
  • Thoughts on Microservices
  • API Design Patterns

Recent Comments

No comments to show.

Archives

  • May 2025
  • September 2024
  • July 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • December 2022
  • December 2021

Categories

  • Development