File: style.php

package info (click to toggle)
php-nunomaduro-termwind 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,172 kB
  • sloc: php: 3,969; makefile: 34
file content (19 lines) | stat: -rw-r--r-- 498 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

use Termwind\Exceptions\StyleNotFound;

use function Termwind\parse;
use function Termwind\style;

it('allows the creation of styles', function () {
    style('btn')->apply('px-4 bg-blue text-white');

    $html = parse('<a class="btn">link text</a>');

    expect($html)->toBe('<bg=blue;fg=white>    link text    </>');
});

it('disalows the usage of non-defined styles', function () {
    expect(fn () => parse('<a class="btn">link text</a>'))
        ->toThrow(StyleNotFound::class);
});