gemorroj/cssvalidator

W3C CSS Validator service.

3.4.0 2023-12-22 13:41 UTC

This package is auto-updated.

Last update: 2024-11-27 12:27:42 UTC


README

Continuous Integration

Requirements:

  • PHP >= 8.0.2

Installation:

composer require gemorroj/cssvalidator

Example:

<?php
use CSSValidator\CSSValidator;

$validator = new CSSValidator();
$result = $validator->validateFragment('#css-code { background: green; }');
$result = $validator->validateFile('/path/to/file.css');
$result = $validator->validateUri('http://example.com/style.css');
$result = $validator->validateUri('http://example.com'); // extract and validate all CSS files on that page

echo $result->getCssLevel();
var_dump($result->isValid());

print_r($result->getErrors());
print_r($result->getWarnings());