The design of HammerTime as an extensible, HTML/CSS-only framework. Everything on this page is rendered with the published stylesheet; the controls below are docs-only JavaScript and are not part of the package.
npm install @went.tf/hammertime-css
Display options
ThemeDirectionStyle
Alerts
Info and warning variants, plus a compact layout with actions.
i
Info alert
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
!
Warning alert
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Plain alert
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Compact alert title
Compact alert text
HTML source
<div class="alert info">
<div class="alert-icon">i</div>
<div class="alert-content">
<div class="alert-title">Info alert</div>
<div class="alert-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
</div>
<div class="alert warning">
<div class="alert-icon">!</div>
<div class="alert-content">
<div class="alert-title">Warning alert</div>
<div class="alert-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
</div>
<div class="alert">
<div class="alert-content">
<div class="alert-title">Plain alert</div>
<div class="alert-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
</div>
<div class="alert compact info">
<div class="alert-content">
<div class="alert-title">Compact alert title</div>
<div class="alert-text">Compact alert text</div>
<div class="alert-actions"><button type="button" class="button"><span class="button-content"><span class="button-text">Compact alert action</span></span></button></div>
</div>
</div>
Buttons
Every colour in the default, disabled, pressed and loading state. Icon-only variants (.icon-only with a .button-icon) follow. The loading state puts a .loading-icon (a slot for any icon, here the clock indicator) over the dimmed content, on a gradient in the button colour.
Loading: put a .loading-icon element before .button-content inside the button. The gradient and the dimming of the content come from it, a button with only .loading shows no gradient. It is a slot for any icon or spinner. .icon-only buttons put their icon in .button-icon.
Icons are slots: the framework ships none. .form-checkbox-check-icon and .form-select-icon are positioned for a fixed-width icon (about 1.25em wide, 1em tall, such as Font Awesome's fa-fw), a text glyph will not line up.
Radio: before v0.1.2 any whitespace between .form-radio-input-wrap and .form-radio-label pushed the label out. From v0.1.2 the control is a flex row and the markup may be formatted freely.
The framework ships no icons, only empty slots for them: .form-checkbox-check-icon, .form-select-icon, .button-icon and .loading-icon. These demos fill them with Font Awesome Free solid icons (CC BY 4.0, fontawesome.com), which are only used by this documentation and are not part of the package. The loading buttons here use the set's spinner icon (spinner) rotated by a docs-only animation, the main demos use the clock indicator. Any inline SVG or icon font works.
The framework ships no icons, only empty slots for them: .form-checkbox-check-icon, .form-select-icon, .button-icon and .loading-icon. These demos fill them with Lucide icons (ISC, lucide.dev), which are only used by this documentation and are not part of the package. The loading buttons here use the set's spinner icon (loader-circle) rotated by a docs-only animation, the main demos use the clock indicator. Any inline SVG or icon font works.
Styling hooks only: toggle .visible (and set an explicit height) from your own script. This demo toggles it with the button.
Details: the CSS reset removes the disclosure marker of <summary> (list-style: none), so a <details> toggle shows no hint that it can be clicked. Give <summary> its own affordance, such as a chevron, a border or a pointer cursor (see the "HTML source" toggles on this page). The framework only styles .collapsible, it never drives .visible for you.
This is the contents of the collapsible container.
Visibility is controlled with the .visible class.
HTML source
<button type="button" class="button" data-demo-toggle="#collapsible-demo"><span class="button-content"><span class="button-text">Toggle visibility</span></span></button>
<div id="collapsible-demo" class="collapsible animate visible">
<div class="collapsible-inner">
<p>This is the contents of the collapsible container.</p>
<p>Visibility is controlled with the <code class="code-span">.visible</code> class.</p>
</div>
</div>
Card
A container with an optional header.
Card title
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
HTML source
<article class="card">
<header class="card-header"><h2>Card title</h2></header>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</article>
--ht-brand playground
Needs the CSS-only build, which derives the palette from --ht-brand at runtime. Edit any custom property below to see it applied live.
Background gradient
The gradient is opt-in in the library ($background-gradient: true in Sass), the compiled stylesheet does not include it. This toggle only paints it with docs-only CSS from the same --ht-color-bg-gradient-* and --ht-value-bg-gradient-* tokens. The middle is the brand color, the start and end follow it until you pick a color.
Token reference
Generated from the compiled Sass token maps. Use the copy button next to a property name to copy it.
Brand (1)
Property
Default
--ht-brand
#5865f2
Values (--ht-value-*) (87)
Property
Default
--ht-value-base-font-size
16px
--ht-value-font-family-base
Montserrat, sans-serif
--ht-value-font-family-mono
Source Code Pro, Consolas, monospace
--ht-value-bg-gradient-opacity
0.5
--ht-value-bg-gradient-start-position
0%
--ht-value-bg-gradient-mid-position
50%
--ht-value-bg-gradient-end-position
100%
--ht-value-bg-gradient-angle
15deg
--ht-value-header-height
3.25rem
--ht-value-header-spacing-horizontal
0.625rem
--ht-value-header-spacing-vertical
0.625rem
--ht-value-header-border
0.0625rem
--ht-value-header-brand-font-size
1.25rem
--ht-value-content-spacing
1rem
--ht-value-content-container-max-width
1080px
--ht-value-content-heading-1
1.8125em
--ht-value-content-heading-2
1.625em
--ht-value-content-heading-3
1.375em
--ht-value-content-heading-4
1.25em
--ht-value-content-heading-margin-bottom
0.25em
--ht-value-button-padding-horizontal
0.375rem
--ht-value-button-padding-vertical
0.25rem
--ht-value-button-border-width
0.0625rem
--ht-value-button-shadow-size
0.125rem
--ht-value-button-border-radius
0.25rem
--ht-value-button-font-size
0.875rem
--ht-value-button-content-gap
0.25rem
--ht-value-button-group-gap
0.375rem
--ht-value-grid-column-gap
0
--ht-value-popup-max-width
400px
--ht-value-popup-wide-max-width
40em
--ht-value-card-padding
1rem
--ht-value-card-border-radius
0.25rem
--ht-value-card-spacing
0.5rem
--ht-value-alert-spacing
1rem
--ht-value-alert-border-radius
0.5rem
--ht-value-popup-border
0.125rem
--ht-value-popup-box-shadow
1rem
--ht-value-input-field-padding
0.375rem
--ht-value-input-field-border
0.0625rem
--ht-value-input-field-color-width
4rem
--ht-value-input-field-color-height
2.5rem
--ht-value-input-field-border-radius
0.25rem
--ht-value-input-field-box-shadow-inset-y
0.0625rem
--ht-value-input-field-box-shadow
0.125rem
--ht-value-form-control-spacing
0.5rem
--ht-value-focus-outline
0.1875em
--ht-value-collapsible-padding
0.375em
--ht-value-collapsible-border-radius
0.5em
--ht-value-form-checkbox-width
1em
--ht-value-form-checkbox-height
1em
--ht-value-form-checkbox-border
0.0625em
--ht-value-form-checkbox-border-radius
0.25em
--ht-value-form-radio-select-icon
65%
--ht-value-form-select-icon-size
1em
--ht-value-form-select-icon-padding
0.25em
--ht-value-table-cell-spacing
0.5em
--ht-value-table-border-size
0.0625em
--ht-value-code-border
0.0625em
--ht-value-code-padding-vertical
0.125em
--ht-value-code-padding-horizontal
0.5em
--ht-value-code-border-radius
0.25em
--ht-value-code-line-height
1.5em
--ht-value-code-small-font-size
0.75em
--ht-value-progress-bar-height
0.75em
--ht-value-loading-indicator-full-revolution-time
5s
--ht-value-badge-border
0.125rem
--ht-value-badge-border-radius
0.5rem
--ht-value-badge-padding-horozontal
0.25rem
--ht-value-badge-spacing
0.25rem
--ht-value-badge-grooup-spacing
0.25rem
--ht-value-badge-font-size
0.875rem
--ht-value-nav-spacing
0.125rem
--ht-value-nav-link-border-radius
0.25rem
--ht-value-nav-link-padding-horizontal
0.375rem
--ht-value-nav-link-padding-vertical
0.25rem
--ht-value-faq-body-padding
0.75rem
--ht-value-faq-body-line-height
1.3
--ht-value-spacing-0
0
--ht-value-spacing-1
0.25em
--ht-value-spacing-2
0.5em
--ht-value-spacing-3
1em
--ht-value-spacing-4
1.75em
--ht-value-size-10
1em
--ht-value-size-15
1.5em
--ht-value-size-20
2em
--ht-value-size-100
10em
Colors (--ht-color-*) (246)
Property
Default
--ht-color-layout-bg-light
#bbb
--ht-color-layout-bg-dark
#000
--ht-color-layout-bg
var(--ht-color-layout-bg-light)
--ht-color-layout-color-light
#313131
--ht-color-layout-color-dark
#C1C2C5
--ht-color-layout-color
var(--ht-color-layout-color-light)
--ht-color-bg-gradient-start-light
hsl(from var(--ht-brand) calc(h + 2) clamp(0, s + 0, 100) clamp(0, l + 0, 100))
--ht-color-bg-gradient-start-dark
hsl(from var(--ht-brand) calc(h + 2) clamp(0, s + 0, 100) clamp(0, l + 0, 100))
--ht-color-bg-gradient-start
var(--ht-color-bg-gradient-start-light)
--ht-color-bg-gradient-mid-light
var(--ht-brand)
--ht-color-bg-gradient-mid-dark
var(--ht-brand)
--ht-color-bg-gradient-mid
var(--ht-color-bg-gradient-mid-light)
--ht-color-bg-gradient-end-light
hsl(from var(--ht-brand) calc(h + 65) clamp(0, s + -59, 100) clamp(0, l + -13, 100))
--ht-color-bg-gradient-end-dark
hsl(from var(--ht-brand) calc(h + 65) clamp(0, s + -59, 100) clamp(0, l + -13, 100))
--ht-color-bg-gradient-end
var(--ht-color-bg-gradient-end-light)
--ht-color-header-bg-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -10, 100) clamp(0, l + 27, 100))
--ht-color-header-bg-dark
#1A1B1E
--ht-color-header-bg
var(--ht-color-header-bg-light)
--ht-color-header-border-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -10, 100) clamp(0, l + 20, 100))
--ht-color-header-border-dark
#2C2E33
--ht-color-header-border
var(--ht-color-header-border-light)
--ht-color-header-brand-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -15, 100) clamp(0, l + -5, 100))
--ht-color-header-brand-dark
#909296
--ht-color-header-brand
var(--ht-color-header-brand-light)
--ht-color-card-bg-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -10, 100) clamp(0, l + 30, 100))
--ht-color-card-bg-dark
#1A1B1E
--ht-color-card-bg
var(--ht-color-card-bg-light)
--ht-color-card-color-light
#313131
--ht-color-card-color-dark
#C1C2C5
--ht-color-card-color
var(--ht-color-card-color-light)
--ht-color-alert-bg-light
rgba(255, 255, 255, 0.2)
--ht-color-alert-bg-dark
rgba(20, 21, 23, 0.2)
--ht-color-alert-bg
var(--ht-color-alert-bg-light)
--ht-color-alert-color-light
rgb(62, 61, 58)
--ht-color-alert-color-dark
rgb(193, 194, 197)
--ht-color-alert-color
var(--ht-color-alert-color-light)
--ht-color-alert-warning-bg-light
rgba(246, 178, 143, 0.2)
--ht-color-alert-warning-bg-dark
rgba(232, 89, 12, 0.2)
--ht-color-alert-warning-bg
var(--ht-color-alert-warning-bg-light)
--ht-color-alert-warning-color-light
#000
--ht-color-alert-warning-color-dark
rgb(255, 255, 255)
--ht-color-alert-warning-color
var(--ht-color-alert-warning-color-light)
--ht-color-alert-warning-hl-color-light
rgb(126, 58, 4)
--ht-color-alert-warning-hl-color-dark
#ffd8a8
--ht-color-alert-warning-hl-color
var(--ht-color-alert-warning-hl-color-light)
--ht-color-button-gradient-shade-light
rgba(0, 0, 0, 0.05)
--ht-color-button-gradient-shade-dark
rgba(0, 0, 0, 0.05)
--ht-color-button-gradient-shade
var(--ht-color-button-gradient-shade-light)
--ht-color-button-border-color-light
rgba(0, 0, 0, 0.2)
--ht-color-button-border-color-dark
rgba(255, 255, 255, 0.2)
--ht-color-button-border-color
var(--ht-color-button-border-color-light)
--ht-color-button-default-color-light
#000
--ht-color-button-default-color-dark
#fff
--ht-color-button-default-color
var(--ht-color-button-default-color-light)
--ht-color-button-default-bg-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -100, 100) clamp(0, l + 20, 100))
--ht-color-button-default-bg-dark
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -100, 100) clamp(0, l + -25, 100))
--ht-color-button-default-bg
var(--ht-color-button-default-bg-light)
--ht-color-button-default-border-color-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -100, 100) clamp(0, l + 10, 100))
--ht-color-button-default-border-color-dark
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -100, 100) clamp(0, l + -30, 100))
--ht-color-button-default-border-color
var(--ht-color-button-default-border-color-light)
--ht-color-button-primary-color-light
#000
--ht-color-button-primary-color-dark
#fff
--ht-color-button-primary-color
var(--ht-color-button-primary-color-light)
--ht-color-button-primary-bg-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + 0, 100) clamp(0, l + 22, 100))
--ht-color-button-primary-bg-dark
var(--ht-brand)
--ht-color-button-primary-bg
var(--ht-color-button-primary-bg-light)
--ht-color-button-primary-border-color-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -10, 100) clamp(0, l + 12, 100))
--ht-color-button-primary-border-color-dark
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -10, 100) clamp(0, l + -10, 100))
--ht-color-button-primary-border-color
var(--ht-color-button-primary-border-color-light)
--ht-color-button-success-color-light
#000
--ht-color-button-success-color-dark
#fff
--ht-color-button-success-color
var(--ht-color-button-success-color-light)
--ht-color-button-success-bg-light
rgb(55.6666666667%, 81%, 43%)
--ht-color-button-success-bg-dark
#559933
--ht-color-button-success-bg
var(--ht-color-button-success-bg-light)
--ht-color-button-success-border-color-light
rgb(45.6%, 71.2%, 32.8%)
--ht-color-button-success-border-color-dark
rgb(26%, 42%, 18%)
--ht-color-button-success-border-color
var(--ht-color-button-success-border-color-light)
--ht-color-button-danger-color-light
#000
--ht-color-button-danger-color-dark
#fff
--ht-color-button-danger-color
var(--ht-color-button-danger-color-light)
--ht-color-button-danger-bg-light
rgb(85%, 55%, 55%)
--ht-color-button-danger-bg-dark
#993333
--ht-color-button-danger-bg
var(--ht-color-button-danger-bg-light)
--ht-color-button-danger-border-color-light
rgb(76%, 44%, 44%)
--ht-color-button-danger-border-color-dark
rgb(42%, 18%, 18%)
--ht-color-button-danger-border-color
var(--ht-color-button-danger-border-color-light)
--ht-color-button-warning-color-light
#000
--ht-color-button-warning-color-dark
#fff
--ht-color-button-warning-color
var(--ht-color-button-warning-color-light)
--ht-color-button-warning-bg-light
rgb(85%, 75%, 55%)
--ht-color-button-warning-bg-dark
#997733
--ht-color-button-warning-bg
var(--ht-color-button-warning-bg-light)
--ht-color-button-warning-border-color-light
rgb(76%, 65.3333333333%, 44%)
--ht-color-button-warning-border-color-dark
rgb(42%, 34%, 18%)
--ht-color-button-warning-border-color
var(--ht-color-button-warning-border-color-light)
--ht-color-button-light-color-light
#222
--ht-color-button-light-color-dark
#222
--ht-color-button-light-color
var(--ht-color-button-light-color-light)
--ht-color-button-light-bg-light
#eee
--ht-color-button-light-bg-dark
#eee
--ht-color-button-light-bg
var(--ht-color-button-light-bg-light)
--ht-color-button-light-border-color-light
#aaa
--ht-color-button-light-border-color-dark
#aaa
--ht-color-button-light-border-color
var(--ht-color-button-light-border-color-light)
--ht-color-button-dark-color-light
#eee
--ht-color-button-dark-color-dark
#eee
--ht-color-button-dark-color
var(--ht-color-button-dark-color-light)
--ht-color-button-dark-bg-light
#222
--ht-color-button-dark-bg-dark
#222
--ht-color-button-dark-bg
var(--ht-color-button-dark-bg-light)
--ht-color-button-dark-border-color-light
#000
--ht-color-button-dark-border-color-dark
#000
--ht-color-button-dark-border-color
var(--ht-color-button-dark-border-color-light)
--ht-color-popup-border-color-light
hsl(from var(--ht-brand) calc(h + 0) clamp(0, s + -10, 100) clamp(0, l + 20, 100))