Heart Love

0 viewsmedium
Background:
Heart Love
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<div class="heart-container2">
  <input type="checkbox" class="checkbox2" />
  <div class="svg-container2">
    <svg viewBox="0 0 24 24" class="svg-outline2" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
    </svg>
    <svg viewBox="0 0 24 24" class="svg-filled2" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
    </svg>
    <svg viewBox="0 0 100 100" class="svg-celebrate2">
      <polygon points="10,10 20,20" />
      <polygon points="10,50 20,50" />
      <polygon points="20,80 30,70" />
      <polygon points="90,10 80,20" />
      <polygon points="90,50 80,50" />
      <polygon points="80,80 70,70" />
    </svg>
  </div>
  <span class="heart-label2">Heart Love</span>
</div>
Was this helpful?

What is inside Heart Love

Heart Love is a CSS checkbox built with a keyframe animation, transforms, defined in 90 lines across 13 selectors.

22
CSS properties
13
Selectors
90
Lines of CSS
3
Formats

Techniques used

Keyframe animationTransitionsTransformsFiltersChecked stateFlexboxCustom properties

Animations defined: keyframes-svg-filled2keyframes-svg-celebrate2

CSS properties in this component

align-itemsanimationanimation-fill-modecolorcursordisplayfillfilterfont-familyfont-sizefont-weightgapheightjustify-contentopacitypositionstrokestroke-widthtransformtransitionwidthz-index

Accessibility check2 to fix

  • Built on a native <input> element, so keyboard focus and screen reader semantics work without extra attributes.
  • No focus style is defined. Add one before shipping, or keyboard users lose track of position.
  • Animates without a prefers-reduced-motion guard. Wrap the animation in that query if motion sensitivity matters to your audience.

These notes are generated by reading this component's own source, so they describe what it actually does rather than what a template says. Copy the code above in HTML, CSS, Tailwind and adapt it freely.