GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - czproject/css-tools: CSS tools for PHP

BranchesTags
Open more actions menu

Latest commit

 

History

34 Commits
34 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
Makefile
Makefile
 
 
code-checker.neon
code-checker.neon
 
 
composer.json
composer.json
 
 
license.md
license.md
 
 
phpstan.neon
phpstan.neon
 
 
readme.md
readme.md
 
 

Repository files navigation

CzProject\CssTools

Build Status Downloads this Month Latest Stable Version License

CSS tools for PHP.

Donate

Installation

Download a latest package or use Composer:

composer require czproject/css-tools

CzProject\CssTools requires PHP 8.0 or later.

Usage

CSS compiler

Expands @import rules in file.

$compiler = new CzProject\CssTools\CssCompiler;
$compiler->compileFile(__DIR__ . '/styles.css'); // overwrite styles.css with compiled version
$compiledStyles = $compiler->processFile(__DIR__ . '/styles2.css');
$compiledStyles = $compiler->processContent(
	'@import "mystyles.css";',
	$stylesheetsRootDirectory
);

CSS generator

$file = new CzProject\CssTools\CssFile;
$file->addRule('.button', [
	'color' => CssTools\Color::hex('#F8A'),
	'font-size' => CssTools\Number::px2rem(48),
	'background-color' => NULL,
]);

echo $file->render();

CSS minifier

$minifier = new CzProject\CssTools\CssMinifier;
$result = $minifier->minify("body {
	color: #333;
	background: #fff;
}");
var_dump($result); // Output: body{color:#333;background:#fff}

License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/

About

CSS tools for PHP

Resources

Readme
License
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.