Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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();
```