Fluid Design Tokens
A lightweight WordPress plugin that generates fluid design tokens as CSS variables, allowing scalable and reusable values for modern responsive WordPress websites.
by Waqas Ahmed, Umair Khan · github.com/theumair07/fluid-design-tokens
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/theumair07/fluid-design-tokens/archive/refs/heads/main.zipA powerful WordPress plugin for managing fluid design tokens using CSS custom properties with automatic viewport detection.
✨ Features
| Feature | Description |
|---|---|
| 🎯 Fluid Design Tokens | Create responsive tokens that automatically scale between mobile and desktop viewports |
| 🔌 Elementor Integration | Automatic viewport detection from Elementor settings |
| 📦 Static Tokens | Support for fixed-value tokens alongside fluid tokens |
| 🎨 Clean Admin Interface | Modern, intuitive admin panel for easy token management |
| 📋 One-Click Copy | Copy token syntax instantly to clipboard |
| 🔍 Search Functionality | Quickly find tokens by name |
| 📥 Import/Export | Export and import tokens as JSON files |
| ⚙️ Flexible Root Font Size | Choose between 100% (1rem = 16px) or 62.5% (1rem = 10px) |
🚀 Installation
- Download the plugin files
- Upload to
/wp-content/plugins/fluid-design-tokens/directory - Activate the plugin through the Plugins menu in WordPress
- Navigate to Design Tokens in the admin menu to start creating tokens
📖 Usage
Creating Fluid Tokens
- Go to Design Tokens in the WordPress admin menu
- Enter a token name (e.g.,
h1,section-padding) - Set minimum size (rem) for mobile viewports
- Set maximum size (rem) for desktop viewports
- Click Add Token
Creating Static Tokens
- Scroll to the Static Tokens section
- Enter a token name (e.g.,
border-width,gap) - Set the fixed value (rem)
- Click Add Static Token
Using Tokens in CSS
/* Typography */
h1 {
font-size: var(--h1);
}
/* Spacing */
.section {
padding: var(--section-padding) 0;
}
/* Multiple Properties */
.card {
padding: var(--card-padding);
gap: var(--card-gap);
font-size: var(--body-text);
}
/* Static Tokens (prefixed with --fs-) */
.element {
border-width: var(--fs-border-width);
}
⚙️ Configuration
Root Font Size
| Setting | Description |
|---|---|
100% |
1rem = 16px (browser default) |
62.5% |
1rem = 10px (easier calculations) |
Viewport Range
| Scenario | Viewport Range |
|---|---|
| With Elementor | Uses your Elementor viewport settings |
| Without Elementor | Default: 320px - 1200px |
🔧 How It Works
The plugin uses the CSS clamp() function to create fluid values:
--token-name: clamp(min-size, viewport-calculation, max-size);
This ensures your design tokens smoothly scale between the minimum and maximum values based on the current viewport width.
📦 Import/Export
| Action | Steps |
|---|---|
| Export | Click Export button → JSON file downloads |
| Import | Click Import button → Select JSON file → New tokens added |
Note: Existing tokens with the same name are skipped during import.
🤝 Credits
Original Developer
- 🌐 Website: iamwaqas.com
- 💻 GitHub: @iamwaqasdotcom
Contributor
- 🌐 Website: umairyousafzai.com
- 💻 GitHub: @theumair07
🌟 Show Your Support
Give a ⭐ if this project helped you!
📄 License
MIT License
Copyright (c) 2025 Waqas Ahmed ✪
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Made with ❤️ by Waqas Ahmed & Umair Khan