library wp-css
Dynamic CSS generator.
rohan2388/wp-css
Dynamic CSS generator.
- Thursday, June 28, 2018
- by rohan2388
- Repository
- 1 Watchers
- 0 Stars
- 6 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 100 % Grown
Dynamic css generator
v3.0.0
Cached dynamic css
<?php
use \RD\WP\Styles;
Styles::init();
Styles::add_rule('.text')
->add_prop( 'color', 'red');
?>
<div class="wrapper <?= Styles::class() ?>">
<div class="text">
This text is red.
</div>
</div>
<?php Styles::done(); ?>
Dynamic css
$css = new \RD\WP\CSS();
$css->add_rule() // Select base class
->add_prop('color', '#000000');
$css->add_rule('a') // Select all <a>
->add_prop('text-decoration', 'none');
```html
styles(); // Print style tag ?>, (*1)
## Inline style
```html
<?php
$styles = array(
'color' => 'blue',
'text-decoration' => 'none'
);
?>
<a href="#" <?php \RD\WP\CSS::inline( $styles ) ?> >This is a link</a>
TODO
- [ ] Fix PHP docBlocks.
- [ ] Remove WP from namespace.
- [ ] Clean up codes
Changelog
v3.0.0
- Added: A new way to dynamically generate css. It will add all the css in
wp_footer
section.
v2.0.0
- Fixed: class name
- Added: Inline style generator
- Some minor changes
v1.0.0
dev-master
9999999-dev
Dynamic CSS generator.
Sources
Download
MIT
The Requires
by
Rohan Das
css
rd
v2.0.0
2.0.0.0
Dynamic CSS generator.
Sources
Download
MIT
The Requires
by
Rohan Das
css
rd
v1.0.0
1.0.0.0
Dynamic CSS generator.
Sources
Download
MIT
The Requires
by
Rohan Das
css
rd