Advent

Day 7: Intro 💬

An intro components usually provides basic information of the page. It is one of the first components on the page.

The example component is visible below.


Welcome to Advent of UI components. 🎄

Every day of Advent, I share a UI component. I do it to apply some recently learned CSS knowledge and share it with the community.


A few notes about this intro component:

  • CSS Variables are used for colors, spacing, and masking,
  • “zig-zag” borders are built with conic gradients (see Temani Afif's pen).

The code:

<div class="advent-intro">
  <h2>Welcome to Advent of UI components.</h2>
  <p>Every day of Advent, I share a UI component. I do it to apply some recently learned CSS knowledge and share it with the community.</p>
</div>
.advent-intro {
  --color-xmas-alpha: #f7efef;
  --color-xmas-beta: #d72621;
  --color-xmas-gamma: #639565;
  --space-xmas-alpha: 1rem;
  --space-xmas-beta: #000 90deg, #0000 0;
  --mask-xmas: conic-gradient(from 135deg at top, var(--space-xmas-beta)) 0 0 / calc(2 * var(--space-xmas-alpha)) var(--space-xmas-alpha) space no-repeat,
    conic-gradient(from -45deg at bottom, var(--space-xmas-beta)) 0 100% / calc(2 * var(--space-xmas-alpha)) var(--space-xmas-alpha) space no-repeat,
    conic-gradient(from 45deg at left, var(--space-xmas-beta)) 0 0 / var(--space-xmas-alpha) calc(2 * var(--space-xmas-alpha)) no-repeat space,
    conic-gradient(from -135deg at right, var(--space-xmas-beta)) 100% 0 / var(--space-xmas-alpha) calc(2 * var(--space-xmas-alpha)) no-repeat space,
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--space-xmas-alpha)) calc(100% - 2 * var(--space-xmas-alpha)) no-repeat;

  background-image: radial-gradient(ellipse at center, var(--color-xmas-gamma), var(--color-xmas-beta) 200%);
  color: var(--color-xmas-alpha);

  text-align: center;

  padding: 5em 2em;
  overflow: hidden;

  -webkit-mask: var(--mask-xmas);
  mask: var(--mask-xmas);
}

.advent-intro h1,
.advent-intro p {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.advent-intro h1 {
  font-size: 2.5rem;
}

.advent-intro p {
  font-size: 1.5rem;
}

Advent of UI components 🎄

Check other UI components.

Day 24: Details 🎹

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 24: Details.

Day 23: Radio button 📱

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 23: Radio button.

Day 22: Checkbox 🧦

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 22: Checkbox.

Day 21: Notification 🤫

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 21: Notification.

Day 20: Code block 💻

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 20: Code block.

Day 19: Pagination 📖

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 19: Pagination.

Day 18: Social share 🔗

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 18: Social share.

Day 17: Card 🎴

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 17: Card.

Day 16: Table 🎶

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 16: Table.

Day 15: Breadcrumb 🍞

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 15: Breadcrumb.

Day 14: Blockquote 💬

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 14: Blockquote.

Day 13: List 🗒️

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 13: List.

Day 12: Figure 🖼️

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 12: Figure.

Day 11: Video embed 📺

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 11: Video embed.

Day 10: Footer 👇

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 10: Footer.

Day 9: Header ☝️

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 9: Header.

Day 8: Hero 🦸‍♂️

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 8: Hero.

Day 6: Horizontal rule 〰️

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 6: Horizontal rule.

Day 5: Split 💔

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 5: Split.

Day 4: Banner 🚩

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 4: Banner.

Day 3: Gallery 🍿

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 3: Gallery.

Day 2: Tag 🎁

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 2: Tag.

Day 1: Button 🎅

During every day of the Advent of UI components, I am showcasing a new UI Component built with HTML, CSS, and JavaScript. Day 1: Button.