Level-2 / Transphporm

Transformation Style Sheets - Revolutionising PHP templating
276 stars 27 forks source link

Valid CSS class name fails #209

Closed cxj closed 4 years ago

cxj commented 6 years ago

The first test works, and the latter fails. It appears to be because of an embedded digit before a hyphen. However, CSS grammar says this is a valid class name.

<?php
require "vendor/autoload.php";

$xml = '<span class="dx-good">FAILS</span>';
$tss = 'span.dx-good { content: "This works"; }';

$template = new Transphporm\Builder($xml, $tss);
$output = $template->output()->body;
echo $output . PHP_EOL;

$xml = '<span class="d1-fail">FAILS</span>';
$tss = 'span.d1-fail{ content: "This works"; }';

$template = new Transphporm\Builder($xml, $tss);
$output = $template->output()->body;
echo $output . PHP_EOL;
TRPB commented 4 years ago

Fixed in master, I'll do a new release with all these changes later this week, I'll try to get all the easy fixes done first.