Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/izica/php-styles
inline css styles generator(conditions support)
https://github.com/izica/php-styles
css css3 generator html inline inline-css inline-styles php php6 styles
Last synced: about 15 hours ago
JSON representation
inline css styles generator(conditions support)
- Host: GitHub
- URL: https://github.com/izica/php-styles
- Owner: izica
- License: mit
- Created: 2018-06-17T14:19:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-09T01:09:07.000Z (over 1 year ago)
- Last Synced: 2024-10-12T15:20:56.355Z (about 1 month ago)
- Topics: css, css3, generator, html, inline, inline-css, inline-styles, php, php6, styles
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Install
```
composer require izica/php-styles
```## Usage
generate inline tag style
```php
$sStyles = (new PhpStylesInline())->opacity(0, $sContact == '')->render();
or
$sStyles = styles(true)->opacity(0, $sContact == '')->render();
or
$sStyles = styles()->inline->opacity(0, $sContact == '')->render();
```
insert style
```html
>
=$sContact;?>
```generate style with class(class styles supports media query)
```php
$sClassname = (new PhpStyles())->media(0, 1024)->opacity(0, $sContact == '')->render();
or
$sClassname = styles()->media(0, 1024)->opacity(0, $sContact == '')->render();
or
$sClassname = styles()
->name('contact-images')
->media(0, 1024)
->set('display', 'flex'),
->set('align-items', 'center', $itemsCount > 4),
->set('align-items', 'flex-start', $itemsCount <= 4),
->set('color', '#ccc')
->opacity(0, $sContact == '')
->render();
```insert style
```html
=$sContact;?>
```## Documentation
* styles() - returns PhpStyles
* styles(true) - returns PhpStylesInline
* PhpStyles
* inline() - returns PhpStylesInline
* media(sizeFrom: number, sizeTo: number)
* set(key: string, value: string or number, condition: bool(not required)) - returns $this(if condition == false, not set)
* render(condition: bool(not required))- returns unique class name(if condition == false, returns empty string)
* opacity(value, condition(not required))
* name(className: string)
* PhpStylesInline
* set(key: string, value: string or number, condition: bool(not required)) - returns $this(if condition == false, not set)
* render(condition: bool(not required))- returns unique class name(if condition == false, returns empty string)
* opacity(value, condition(not required))