Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sikessem/dom
Handle HTML5 and CSS3 easily
https://github.com/sikessem/dom
code-builder code-generator css frontend html php-lib sikessem ske
Last synced: about 1 month ago
JSON representation
Handle HTML5 and CSS3 easily
- Host: GitHub
- URL: https://github.com/sikessem/dom
- Owner: sikessem
- License: apache-2.0
- Created: 2021-03-18T13:45:07.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-20T16:24:03.000Z (over 3 years ago)
- Last Synced: 2024-04-21T01:42:35.003Z (8 months ago)
- Topics: code-builder, code-generator, css, frontend, html, php-lib, sikessem, ske
- Language: PHP
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP DOM
Handle HTML5 and CSS3 easily
An example to see how the code works :
The ```Styper``` code
```Styper
[lang="fr"]
{color:red;}
(
(
[charset="UTF-8"]
(Styper source)
)
(
[id="main-content"]{color:blue}(Welcome to Styper !)
)
)
```The equivalent ```HTML5``` code
```html
Styper source
html
{
color: red;
}
p#main-content
{
color: blue;
}
Welcome to Styper !
```
The equivalent ```PHP5``` code
```php
setAttribute('lang', 'fr');
$document->setProperty('color', 'red');
$document->head->meta->charset = 'UTF-8';
$document->title = 'Welcome to Styper !';
$p = $document->createElement('p');
$p->setAttribute('id', 'main-content');
$p->setProperty('color', 'red');
$p->setContent('Welcome to Styper !');
$document->prepend($p, $body);
$document->save();
```