A CSS and JavaScript framework designed for Webflow projects using the Harvey Component Library. This framework provides reusable components, utilities, and styling systems.
Add this single line to your Webflow project's custom code (<head> section):
<!-- Production (recommended): Minified with Lightning CSS, ~198KB -->
<link rel="stylesheet" href="https://webflow.teamharvey.co/css/main.css" />
<!-- Stable versioned snapshot (pin to specific build): -->
<link rel="stylesheet" href="https://webflow.teamharvey.co/v/2025-11-13/v1/css/main.css" />Optional: Add JavaScript functionality before closing </body> tag:
<script src="https://webflow.teamharvey.co/js/main.js"></script>Optional: Add filter tracking (loads separately):
<script src="https://webflow.teamharvey.co/js/filter-tracking.js"></script>webflow-framework/
βββ src/ # Source files (private)
β βββ css/
β βββ imports.css # Build input file (defines import order)
β βββ core/ # Core framework components
β β βββ base.css
β β βββ buttons.css
β β βββ corners.css
β β βββ fluid-sizing.css
β β βββ gap.css
β β βββ grid.css
β β βββ max-lines.css
β β βββ richtext-extras.css
β βββ framework-mapping/ # CSS variable mappings
β β βββ colour/
β β β βββ primitive.css
β β β βββ semantic.css
β β β βββ semantic-buttons.css
β β βββ fonts/
β β β βββ base.css
β β β βββ rich-text.css
β β βββ sizing/
β β β βββ border-corner.css
β β β βββ button.css
β β β βββ gap-spacing.css
β β β βββ general.css
β β βββ framework.css
β βββ icons/ # Icon system
β βββ base.css
β βββ content.css
β βββ mapping.css
β βββ simple.css
βββ dist/ # Built files (public)
β βββ css/
β β βββ main.css # Production version (198KB, minified)
β β βββ main.2025-11-13-v1.css # Version-tagged for long-term caching
β β βββ main.unminified.css # Debug version (226KB, unminified)
β βββ js/ # JavaScript functionality
β β βββ main.js # Main JS loader
β β βββ main.2025-11-13-v1.js # Version-tagged for long-term caching
β β βββ external-links.js # Auto-handle external links
β β βββ insert-data.js # Data insertion utilities
β β βββ query-param-to-form.js # URL params to form fields
β β βββ social-share.js # Social sharing functionality
β β βββ tooltip.js # Interactive tooltips
β β βββ filter-tracking.js # Optional: filter analytics (not auto-loaded)
β βββ _redirects # Netlify redirects for cache busting
β βββ _headers # Cache-Control headers for optimal performance
β βββ v/ # Versioned snapshots (ignored in git)
β βββ 2025-10-01/
β β βββ v1/ # First build of the day
β β βββ css/
β β βββ js/
β βββ 2025-10-02/
β βββ v1/ # Versioned builds
β βββ v2/
β βββ v3/
βββ build.js # Build script (Lightning CSS)
βββ netlify.toml # Deployment configuration
βββ README.md
- Base Styles: Foundation styling and resets
- Grid System: Flexible grid layouts
- Buttons: Comprehensive button styling system
- Fluid Sizing: Responsive sizing utilities
- Gap & Spacing: Consistent spacing system
- Corners: Border radius utilities
- Text Controls: Multi-line text truncation
- Color System: Primitive and semantic color tokens
- Typography: Base fonts and rich text styling
- Sizing System: Consistent sizing scales
- Button Variants: Semantic button styles
- Base Icons: Core icon styling
- Content Icons: Content-specific icons
- Icon Mapping: Icon utility classes
- External Links: Automatically opens external links in new tabs with proper security attributes
- Tooltip System: Interactive tooltips for enhanced UX
- Social Sharing: One-click social media sharing functionality
- Form Utilities: Automatically populate form fields from URL query parameters
- Smart Loading: Main.js automatically loads all modules with error handling
The framework uses an intelligent caching strategy for optimal performance:
<!-- Stable URL that redirects to the latest version-tagged file -->
<link rel="stylesheet" href="https://webflow.teamharvey.co/css/main.css" />
<script src="https://webflow.teamharvey.co/js/main.js"></script><!-- Pin to specific date and version for guaranteed stability -->
<link rel="stylesheet" href="https://webflow.teamharvey.co/v/2025-11-13/v1/css/main.css" />
<script src="https://webflow.teamharvey.co/v/2025-11-13/v1/js/main.js"></script>Cache Performance Strategy:
- Stable URLs (
/css/main.css,/js/*.js) β 302 redirect to version-tagged files- Cache-Control:
public, max-age=0, must-revalidate(always fresh)
- Cache-Control:
- Version-tagged files (
main.2025-11-13-v1.css) β Immutable, cached for 1 year- Cache-Control:
public, max-age=31536000, immutable
- Cache-Control:
- Result: Browsers cache assets long-term while stable URLs stay fresh
Versioning:
- Each deployment creates a new dated snapshot in
/v/{YYYY-MM-DD}/v{N}/ - Multiple builds per day get incremental versions (v1, v2, v3...)
- All previous versions remain available permanently
- Format:
v/{YYYY-MM-DD}/v{N}/css/main.css
- β Latest URL - Development, always get newest features with browser caching
- β Versioned snapshots - Production projects, client sites, guaranteed stability
- β Staging environments - Test new versions before pinning to production
- 18 sequential HTTP requests via @import statements
- ~220KB total download across multiple files
- Render-blocking CSS loading waterfall
- No browser caching (always re-downloaded)
- 1 HTTP request (single concatenated file)
- 198KB minified with Lightning CSS (12% reduction)
- Eliminates render-blocking import chain
- Long-term browser caching via version-tagged files (1-year immutable cache)
- Stable URLs automatically redirect to latest cached version
- Significant improvement on mobile, slower connections, and repeat visits
-
Add the CSS framework to your Webflow project (
<head>):<link rel="stylesheet" href="https://webflow.teamharvey.co/css/main.css" />
-
Add JavaScript functionality (before
</body>):<script src="https://webflow.teamharvey.co/js/main.js"></script>
If you only need specific components, you can import them individually:
CSS Components:
<!-- Just the button system -->
<link rel="stylesheet" href="https://webflow.teamharvey.co/css/core/buttons.css" />
<!-- Just the grid system -->
<link rel="stylesheet" href="https://webflow.teamharvey.co/css/core/grid.css" />JavaScript Modules:
<!-- Just external links functionality -->
<script src="https://webflow.teamharvey.co/js/external-links.js"></script>
<!-- Just tooltip functionality -->
<script src="https://webflow.teamharvey.co/js/tooltip.js"></script>The framework dispatches a custom event when all modules are loaded:
<script>
document.addEventListener("webflowFrameworkReady", function (e) {
console.log("π Framework ready!", e.detail);
// Your custom code here
});
</script>Enable debug logging by adding ?debug to your URL:
Visit: https://yoursite.com/?debug
When debug mode is active, you'll see structured logs in the console:
[Framework][Initialisation] Loading JavaScript modules...
[Framework][Module Load] Loaded tooltip.js
[Tooltip][Initialisation] Container element with id 'tooltip-container' not found
Access framework debug information in the browser console:
// Check if debug mode is active
console.log(window.WebflowFramework.isDebugMode);
// Check what modules are loaded
console.log(window.WebflowFramework.modules);
// Manually trigger debug logging (only works when ?debug is in URL)
window.WebflowFramework.debug("My Feature", "Test", "Custom debug message");
// Manually reload all JavaScript modules
window.WebflowFramework.reload();-
Clone the repository:
git clone https://github.com/Harvey-AU/webflow-framework.git
-
Install dependencies:
npm install
-
Edit source files:
- CSS: Edit files in
src/css/subfolders - JS: Edit files directly in
dist/js/(no build needed) - Add new CSS files: Update
src/css/imports.cssimport order
- CSS: Edit files in
-
Test build locally:
node build.js
-
Commit and push changes:
git add . git commit -m "Update button styles" git push origin main
-
Automatic deployment:
- Netlify builds and deploys within 1-2 minutes
- Creates new versioned snapshot automatically
- Both latest and versioned URLs updated
The framework uses Lightning CSS for optimal performance:
- Reads
src/css/imports.cssto understand import order - Concatenates all imported CSS files into single files
- Minifies using Lightning CSS (Rust-based, fastest available)
- Outputs both debug and production versions
- Creates automatic versioned snapshots
Build outputs:
dist/css/main.css- Production version (198KB, Lightning CSS minified)dist/css/main.{version-tag}.css- Version-tagged file for long-term cachingdist/css/main.unminified.css- Debug version (226KB, unminified)dist/js/*.js- Original JS files (stable URLs)dist/js/*.{version-tag}.js- Version-tagged JS files for long-term cachingdist/_redirects- Netlify 302 redirects from stable URLs to version-tagged filesdist/_headers- Cache-Control headers for optimal caching strategydist/v/{date}/v{n}/- Versioned snapshots for backwards compatibility
Build files:
src/css/imports.css- Source file defining import orderbuild.js- Build script using Lightning CSSnetlify.toml- Deployment configuration (publish = "dist")package.json- Lightning CSS and esbuild dependencies
The framework loads components in this order:
- Core base styles
- Framework mapping (colors, fonts, sizing)
- Core components
- Icons
- Library backend styles
JavaScript modules are loaded asynchronously in parallel for optimal performance.
To add a new JavaScript module to the framework:
- Create your
.jsfile in the/js/directory - Add the filename to the
JS_MODULESarray inmain.js - Commit and push - the module will be automatically loaded
This framework is hosted via Netlify for optimal performance and reliability.
- Base URL:
https://webflow.teamharvey.co/ - Update Time: 1-2 minutes after pushing changes
- Caching Strategy:
- Stable URLs β 302 redirect (always revalidate)
- Version-tagged files β Immutable, 1-year cache
- Optimal for both development and production use
- Reliability: Backed by Netlify's global CDN infrastructure
- Performance: Long-term browser caching eliminates redundant downloads
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-component) - Make your changes
- Test in a Webflow project
- Commit changes (
git commit -m 'Add new component') - Push to branch (
git push origin feature/new-component) - Open a Pull Request
- Use kebab-case for all file names
- Organise by functionality/category
- Keep individual files focused on single components
- Use descriptive names (e.g.,
semantic-buttons.cssnotbuttons2.css)
- Add animation utilities
- Expand icon system
- Add dark mode support
- Create component documentation
MIT License - feel free to use in any project, but only really works with the Harvey Component library.
Found a bug or need a feature? Open an issue on GitHub.
Made with β€οΈ for the Webflow community