Common CSS (Spacing & Position Utilities)
FrankUI provides utility helper classes for rapid layout adjustments, positioning elements, and spacing. These utilities form the foundation for more advanced responsive interfaces.
4px (defined as --spacing-step). For example, a level 5 spacing represents 20px (5 × 4px).
Visual Spacing Playground
Use the controls below to dynamically adjust the margin and padding levels on the sample element, simulating how the CSS spacing scales look in practice.
Classes Reference
All spacing classes use the format [property][direction]-[level]. The following values are supported:
| Properties | Directions | Levels (1 to 10) |
|---|---|---|
Margin: m-Padding: p-
|
(None) - All sides t - Top r - Right b - Bottom l - Left |
1: 4px | 2: 8px | 3: 12px 4: 16px | 5: 20px | 6: 24px 7: 28px | 8: 32px | 9: 36px 10: 40px |
Static HTML Usage Example
<!-- Card component with margin bottom level 6 (24px) and padding level 4 (16px) -->
<div class="card mb-6 p-4">
<div class="card-header">Spacing Utilities</div>
<div class="card-content">
<button class="btn primary mt-3 mr-2">Submit</button>
<button class="btn secondary mt-3">Cancel</button>
</div>
</div>
Positioning Classes
Use position utilities to layout elements, build sticky headers, overlay actions, or create fixed components.
Live Position Demo
Select a class to position the target box (blue) within the viewport container (gray dotted border, relative layout).
Scroll inside this box to test sticky positioning.
Additional sandbox content representing height...
Base Utilities Reference
| Class | Applied Style | Usage Notes |
|---|---|---|
| .pos-static | position: static !important; | Default normal document flow. |
| .pos-relative | position: relative !important; | Positioned relative to its normal flow; acts as anchor for absolute elements. |
| .pos-absolute | position: absolute !important; | Positioned relative to the nearest positioned ancestor. |
| .pos-fixed | position: fixed !important; | Positioned relative to the viewport. Remains in place on scroll. |
| .pos-sticky | position: sticky !important; top: 0 !important; align-self: flex-start !important; |
Behaves relative until scrolling reaches a threshold, then sticks. |
| .fixed-top | position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; |
Affixes an element to the very top of the window, spanning full width. |
| .fixed-bottom | position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; |
Affixes an element to the very bottom of the window, spanning full width. |
Best Practices
- Creating Positioning Contexts: Use
.pos-relativeto create a positioning context for absolutely positioned child elements. - Fixed Headers and Footers: When using
.fixed-topor.fixed-bottom, add appropriate padding to the body or main content to prevent content from being hidden behind these fixed elements. - Sticky Positioning: Be aware that
.pos-stickyrequires a scrollable container and may not work in all browsers. Always test thoroughly. - Responsive Positioning: Use responsive variants to change positioning behavior based on screen size, which is particularly useful for navigation elements that might be fixed on desktop but static on mobile.
- Combining with Other Utilities: These position utilities work well with other framework utilities:
- Use with spacing utilities to add padding or margin
- Use with z-index utilities to control stacking order
- Use with width and height utilities to control dimensions
Responsive Breakpoints
Position helper classes have responsive variations that apply at specific viewport width thresholds. The pattern follows .{class}-{breakpoint}.
.pos-sticky, .fixed-top, and .fixed-bottom do not have responsive variants.
| Breakpoint Prefix | Applies At | Example Class |
|---|---|---|
| -xs | ≥ 480px | .pos-relative-xs |
| -sm | ≥ 576px | .pos-absolute-sm |
| -md | ≥ 768px | .pos-static-md |
| -lg | ≥ 992px | .pos-fixed-lg |
| -xl | ≥ 1200px | .pos-relative-xl |
| -xxl | ≥ 1400px | .pos-absolute-xxl |
| -xxxl | ≥ 1600px | .pos-static-xxxl |
Responsive Code Example
<!-- Absolute positioned block on large screens, standard relative block on mobile -->
<div class="pos-relative pos-absolute-lg" style="top: 20px; right: 20px;">
<span>Responsive Badge</span>
</div>
<!-- Element fixed on tablet screens and above, static on mobile -->
<div class="pos-static pos-fixed-md" style="bottom: 10px; left: 10px;">
<p>Floating Action Bar</p>
</div>
Heading Typography Sizes
The framework specifies customizable typography sizes for all standard heading elements (H1 to H6) using CSS root variables. These can be overridden dynamically or in your custom stylesheets.
Live Typography Scaling
Modify the values below to adjust heading sizes across the site dynamically.
H1 Heading Size Sample
H2 Heading Size Sample
H3 Heading Size Sample
H4 Heading Size Sample
H5 Heading Size Sample
H6 Heading Size Sample
Typography Variables Reference
| Variable | Default Value | Description |
|---|---|---|
| --h1-size | 2rem | Font size for h1 headings |
| --h2-size | 1.5rem | Font size for h2 headings |
| --h3-size | 1.25rem | Font size for h3 headings |
| --h4-size | 1rem | Font size for h4 headings |
| --h5-size | 0.875rem | Font size for h5 headings |
| --h6-size | 0.75rem | Font size for h6 headings |
Display Classes
Large, eye-catching text styles for hero sections, titles, and major landing page headers:
| Class | Font Size | Font Weight |
|---|---|---|
| .display4 | 112px | 200 (Light) |
| .display3 | 56px | 400 (Regular) |
| .display2 | 48px | 400 (Regular) |
| .display1 | 36px | 400 (Regular) |
Heading Classes
Heading helper classes let you apply standard heading font sizes to any HTML tag (like <span>, <p>, or <div>):
P tag with class .h2
Live Font Settings Customizer
Customize the global font family, base size, line height, and font weight variables to see how they modify the document's body text rendering.
This preview paragraph uses the --font-name, --font-size, --line-height, and --font-weight variables. Changing the inputs above will dynamically update these variables in real-time inside the isolated container styles.
Font Settings Reference
Metro UI uses CSS variables to configure the primary font styles globally. These can be adjusted at the root stylesheet:
| Variable | Default Value | Description |
|---|---|---|
| --font-name | -apple-system, BlinkMacSystemFont, "Segoe UI", ... | System font stack prioritizing local OS rendering |
| --font-size | 1rem | Base typography font size for body elements |
| --line-height | 1.5 | Base line height for layout copy readability |
| --font-weight | 400 | Default text font weight |
Cursor Utilities
FrankUI offers a comprehensive suite of utility classes to control the mouse cursor display. All classes use the .c-[type] naming convention.
Interactive Hover Sandbox
Hover your mouse over the cards below to see the respective cursors render live in your browser.
Cursor Reference Table
| Class | CSS Property | Description |
|---|---|---|
| .c-auto | cursor: auto; | Default cursor context |
| .c-default | cursor: default; | Standard arrow |
| .c-none | cursor: none; | No cursor rendered |
| .c-help | cursor: help; | Help question mark |
| .c-pointer | cursor: pointer; | Hand icon for links |
| .c-progress | cursor: progress; | Loading arrow + circle |
| .c-wait | cursor: wait; | Hourglass wait indicator |
| .c-cell | cursor: cell; | Spreadsheet cell target cross |
| .c-crosshair | cursor: crosshair; | Selection crosshair |
| .c-text | cursor: text; | I-beam text select bar |
| .c-text-vertical | cursor: vertical-text; | Vertical text selector |
| .c-alias | cursor: alias; | Shortcut link alias arrow |
| .c-copy | cursor: copy; | Copy utility addition sign |
| .c-move | cursor: move; | Movement drag pointer |
| .c-no-drop | cursor: no-drop; | Cannot release drop here |
| .c-not-allowed | cursor: not-allowed; | Action forbidden / Disabled |
| .c-all-scroll | cursor: all-scroll; | Scroll viewport directions |
| .c-col-resize | cursor: col-resize; | Column adjust horizontal resize |
| .c-row-resize | cursor: row-resize; | Row adjust vertical resize |
| .c-n-resize | cursor: n-resize; | North resize arrow |
| .c-e-resize | cursor: e-resize; | East resize arrow |
| .c-s-resize | cursor: s-resize; | South resize arrow |
| .c-w-resize | cursor: w-resize; | West resize arrow |
| .c-ne-resize | cursor: ne-resize; | Northeast resize diagonal |
| .c-nw-resize | cursor: nw-resize; | Northwest resize diagonal |
| .c-se-resize | cursor: se-resize; | Southeast resize diagonal |
| .c-sw-resize | cursor: sw-resize; | Southwest resize diagonal |
| .c-ew-resize | cursor: ew-resize; | East-West resize arrow |
| .c-ns-resize | cursor: ns-resize; | North-South resize arrow |
| .c-nesw-resize | cursor: nesw-resize; | NE-SW resize diagonal |
| .c-nwse-resize | cursor: nwse-resize; | NW-SE resize diagonal |
| .c-zoom-in | cursor: zoom-in; | Zoom in magnifier |
| .c-zoom-out | cursor: zoom-out; | Zoom out magnifier |
| .c-grab | cursor: grab; | Grabbable open hand |
| .c-grabbing | cursor: grabbing; | Grabbing closed fist |
Visibility & Display Utilities
Control elements visibility and display states dynamically. These classes are useful for toggling sections, constructing grid systems, or responsive visibility.
Live Display & Visibility Sandbox
Select a display or visibility utility to see how it affects the target element (blue) and the surrounding elements (green & red).
Display & Visibility Classes Reference
| Class | Applied Style | Description |
|---|---|---|
| .visible | visibility: visible !important; | Makes an element visible |
| .no-visible | visibility: hidden !important; | Hides an element but preserves its space in layout |
| .d-none | display: none !important; | Hides an element completely |
| .d-block | display: block !important; | Displays an element as block-level |
| .d-inline | display: inline !important; | Displays an element as inline flow |
| .d-inline-block | display: inline-block !important; | Displays an element as inline-block |
| .d-table | display: table !important; | Displays an element as a table container |
| .d-table-row | display: table-row !important; | Displays an element as a table row |
| .d-table-cell | display: table-cell !important; | Displays an element as a table cell |
Responsive Breakpoint Utilities
Responsive visibility classes let you show or hide elements at specific breakpoints (e.g. .d-none-md, .visible-lg):
| Breakpoint Prefix | Applies At | Example Display Class | Example Visibility Class |
|---|---|---|---|
| -xs | ≥ 480px | .d-block-xs | .visible-xs |
| -sm | ≥ 576px | .d-none-sm | .no-visible-sm |
| -md | ≥ 768px | .d-inline-block-md | .visible-md |
| -lg | ≥ 992px | .d-table-lg | .no-visible-lg |
| -xl | ≥ 1200px | .d-none-xl | .visible-xl |
| -xxl | ≥ 1400px | .d-block-xxl | .no-visible-xxl |
| -xxxl | ≥ 1600px | .d-inline-xxxl | .visible-xxxl |
Responsive Visibility Code Example
<!-- Hide completely on mobile, display as block on desktop (large screens) -->
<div class="d-none d-block-lg">
<p>Desktop-only content</p>
</div>
<!-- Preserve layout spacing but hide on medium screens and up -->
<div class="visible no-visible-md">
<p>Placeholder space...</p>
</div>
Border Utilities
FrankUI includes lightweight border helpers to quickly apply borders, styles, colors, thicknesses, and rounded corners without custom styling rules.
Live Border Sandbox
Customize the border classes on the target element below to see how they render in real-time.
Borders Reference
| Class Name | Applied Style | Description |
|---|---|---|
| .border | border: 1px solid var(--secondary-color) !important; | Adds a border on all sides |
| .border-top | border-top: 1px solid var(--secondary-color) !important; | Adds a top border |
| .border-right | border-right: 1px solid var(--secondary-color) !important; | Adds a right border |
| .border-bottom | border-bottom: 1px solid var(--secondary-color) !important; | Adds a bottom border |
| .border-left | border-left: 1px solid var(--secondary-color) !important; | Adds a left border |
| .border-solid .border-dashed .border-dotted | border-style: solid !important; border-style: dashed !important; border-style: dotted !important; | Controls the border drawing style |
| .border-size-1 ... 20 | border-width: [level]px !important; | Sets border thickness (1px to 20px) |
| .border-radius-1 ... 20 | border-radius: [level]px !important; | Sets border roundedness (1px to 20px) |
| .rounded | border-radius: 4px !important; | Applies default rounded corner |
| .to-cycle | border-radius: 50% !important; | Transforms block into a circle/oval |
| .bd-primary .bd-success .bd-alert | border-color: var(--primary-color) !important; border-color: var(--success-color) !important; border-color: var(--alert-color) !important; | Sets border color mapping to framework theme variables |
Removing Borders (Responsive Variants)
Borders can be removed globally or per direction. You can also hide borders selectively starting at any breakpoint (e.g. .border-none-md, .border-top-none-lg):
| Class Pattern | Description |
|---|---|
| .border-none | Removes all borders |
| .border-[direction]-none | Removes border on specific side (top, right, bottom, left) |
| .border-none-{breakpoint} | Removes all borders at breakpoint and above (xs, sm, md, lg, xl, xxl, xxxl) |
| .border-[direction]-none-{breakpoint} | Removes border on side starting at breakpoint and above |
Border Markup Code Example
<!-- Div with 3px dashed primary color border and custom rounded corners -->
<div class="border border-dashed border-size-3 border-radius-8 bd-primary p-4">
<p>Custom styled container</p>
</div>
<!-- Button circular with solid success color border -->
<button class="border border-solid border-size-2 to-cycle bd-success">
✏️
</button>
Color Utilities
Apply background, foreground (text), and border colors quickly using prefix-based utility classes. All color utilities are defined with !important to guarantee they apply consistently.
.bg-[color-name]- Sets background color.fg-[color-name]- Sets text/foreground color.bd-[color-name]- Sets border color
Primary Colors
Extended Colors
Neutral & Special Colors
Code Example
<!-- Custom alert panel using theme colors -->
<div class="bg-light border border-solid border-size-1 bd-orange p-3 rounded">
<h4 class="fg-crimson mt-0">Warning Notice</h4>
<p class="fg-charcoal mb-0">This action cannot be undone.</p>
</div>
<!-- Cobalt colored badge -->
<span class="bg-cobalt fg-white p-1 rounded">Admin</span>
Flexbox Utilities
FrankUI provides standard flexbox utilities to construct responsive layouts, manage child alignments, distribution, wrapping, and spacings in real-time.
Live Flexbox Sandbox
Customize the flex direction, justification, alignment, and gap to see how the child items flow.
Flexbox Reference
| Class Pattern | Applied Style | Description |
|---|---|---|
| .d-flex .d-inline-flex | display: flex !important; display: inline-flex !important; | Enables flex context on container |
| .flex-row .flex-column ...-reverse | flex-direction: row !important; flex-direction: column !important; ...-reverse !important; | Controls flow direction of flex children |
| .flex-wrap .flex-nowrap .flex-wrap-reverse | flex-wrap: wrap !important; flex-wrap: nowrap !important; flex-wrap: wrap-reverse !important; | Controls wraps when children exceed dimensions |
| .flex-justify-start ... end ...-center / between / around | justify-content: flex-start !important; justify-content: space-between !important; | Distributes children along the main flow axis |
| .flex-align-start ... end ...-center / stretch | align-items: flex-start !important; align-items: center !important; | Aligns children along the cross axis |
| .flex-self-start ... end ...-center / stretch | align-self: flex-start !important; align-self: center !important; | Applied to children; overrides parent's cross alignment |
| .flex-grow-0 .flex-grow-1 | flex-grow: 0 !important; flex-grow: 1 !important; | Controls item growth capacity |
| .order-0 ... 12 | order: [index] !important; | Sets rendering order order index |
| .gap-0 ... 12 | gap: [level * 4]px !important; | Sets spacing gap between rows/columns (0px to 48px) |
Responsive Breakpoint Utilities
Responsive variants (e.g. .flex-column-md) allow you to rearrange column listings on mobile/tablets into side-by-side row grids on desktop:
<!-- Stack on mobile, horizontal row layout on desktop (medium screen & above) -->
<div class="d-flex flex-column flex-row-md gap-4">
<div class="card">Sidebar content</div>
<div class="card flex-grow-1">Main content area</div>
</div>
Image Utilities
Apply sizing, responsiveness, thumbnails, and interactive hover overlays directly to images in FrankUI.
Live Layout Previews
Hover over the cards below to see zoom scaling and sliding overlays in action.
Fluid Responsive (.img-fluid)
Scales dynamically to fit the width of its parent block.
Thumbnail (.img-thumbnail)
Adds standard padding, a subtle border, and background frame.
Container Overlay (.img-container)
Combines zoom, overlays, and transition slide-up effects.
Images Reference
| Class | Properties | Description |
|---|---|---|
| .img-fluid | max-width: 100% !important; height: auto !important; | Makes an image scale responsively inside its parent wrapper |
| .img-thumbnail | padding: .25rem !important; border: 1px solid var(--secondary-color) !important; border-radius: 4px !important; | Framer thumbnail style with padding, border, and background |
| .img-container | position: relative; overflow: hidden; display: inline-block; | Position context wrapper enabling overlays and zooms |
| .zoom | transform: scale(1.08); | Applied to .img-container; zooms image slightly on hover |
| .image-overlay | position: absolute; opacity: 0; transition: opacity .3s; | Overlay block placed inside .img-container; fades in on hover |
| .slide-up | transform: translateY(100%); transition: transform .3s; | Applied to .img-container; makes overlay slide up from bottom |
Code Example
<!-- Responsive fluid image wrapper with zoom and sliding text overlay -->
<div class="img-container zoom slide-up rounded">
<img src="ocean-view.jpg" alt="Ocean View">
<div class="image-overlay">
<h4>Ocean Breeze</h4>
<p>Sunset at the coastline</p>
</div>
</div>
DOM Selector Wrapper ($)
FrankUI includes a lightweight, vanilla wrapper function $() that offers a jQuery-like API for element selection, property retrieval/mutations, checking matches, and event bindings without the overhead of loading the entire jQuery library.
Live Wrapper Playground
Interact with the controls below and trigger wrapper methods to see returned outputs logged in real-time.
API Reference
| Method | Signature | Description |
|---|---|---|
| $(selector) | $(string | element | list) | Selects element(s) and returns selector wrapper context |
| .val() | .val( [value] ) | Gets or sets the value of selected input/control element |
| .prop() | .prop( propertyName, [value] ) | Gets or sets properties (e.g. checked, disabled) of elements |
| .is() | .is( selectorStr ) | Checks matches against selector helper (e.g. :checked, :disabled) |
| .on() / .click() | .on( events, handler ) | Binds event listener(s) to all selected elements |
| .addClass() / .removeClass() | .addClass( className ) | Adds or removes class strings from element lists |
| .toggleClass() | .toggleClass( className ) | Toggles CSS classes of matched element arrays |
| .find() | .find( selector ) | Searches descendants matching selector |
| .parent() / .closest() | .closest( selector ) | Finds parent element or closest matching ancestor wrapper |
| .attr() | .attr( name, [value] ) | Gets or sets DOM attributes |
| .text() / .html() | .text( [content] ) | Gets or sets textContent / innerHTML configurations |
| .css() | .css( prop, [value] ) | Gets or sets CSS styling values dynamically |
| .trigger() | .trigger( eventName ) | Triggers custom or built-in event calls on elements |
Code Example
// Perform tasks using standard jQuery syntax
$('#my-form').on('submit', function(e) {
if ($('#agree-check').is(':checked')) {
console.log('User value:', $('#username').val());
$('#agree-check').prop('disabled', true);
} else {
e.preventDefault();
$('#error-msg').text('You must accept the terms first!').addClass('fg-red');
}
});