A lightweight WordPress plugin for visually managing CSS classes in the Block Editor.
📦 Download
- 🔖 Visual Token Management - Manipulate CSS classes as visual tokens
- ⚡️ Quick Actions - Copy, sort, and remove classes with one click
- 🔍 Enhanced Modal - Full-featured management with advanced sorting options
- ⌨️ Keyboard Shortcut - Press
alt + c
(oroption + c
on Mac) to quickly access - 🙈 Core CSS Field Hidden - Replaces the default field in the Advanced panel
- Upload and activate the plugin
- Select any block in the editor
- Find the token field in the Advanced panel
- Add, remove, and manage CSS classes visually
- Add classes by typing and pressing Enter/Space
- Remove classes by clicking × on any token
- Use quick actions: Copy, Sort, Clear, Manage
- Token Management - Add/remove with visual tokens
- Text Editing - Edit classes directly in text area
- Sorting Options:
- Auto Sort (intelligent best practices)
- Alphabetical
- Length
- Move block styles to end
- Cleanup:
- Clear custom classes
- Clear all classes
- Class names are validated using regex for proper CSS naming conventions
- WordPress block style classes (
is-style-*
) receive special handling - Changes sync with the core WordPress class input field
ClassAct uses PHPUnit for testing critical plugin functionality. The test suite covers:
- Plugin initialization and assets loading
- Automatic update system
- PSR-4 autoloader functionality
-
Install development dependencies:
composer install
-
Set up the WordPress test environment (requires MySQL):
composer run setup-local-tests
-
Run the tests:
composer test
-
Generate code coverage report:
composer run test:coverage
Customize the keyboard shortcut:
add_filter('classact_keyboard_shortcut', function($shortcut) {
return array(
'modifier' => 'ctrl',
'character' => 'c',
);
});
Valid modifiers: alt
, ctrl
, shift
, meta
(Command on Mac)