Download the PHP package csstool/css without Composer

On this page you can find all versions of the php package csstool/css. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package css

CSSTool logo
Another tool to parse CSS, minify and optimize CSS properties and values

https://igorfaria.github.io/CSSTool/

CSS Tool

Another CSS tool in CSS.

This is a CSS optimizer that parse CSS code into a set of associatives arrays.
You can manipulate the CSS with PHP and execute the magic of optimization, outputing the result as a text or save into a file.

Optimizations

Installing

You can install via Composer using:

Or you can download the files directly from github.com and include the files that are in the /src/ folder by your own means.

Usage

You can use the CSS Tool to optimize one or multiple CSS files, outputing as a text or saving into a file.

And of course you can do much more, just check the public methods and you can do see that there is a lot more to do with CSS Tool. If you have a task that involve manipulate CSS with PHP or just minify and optimize CSS, this is it.

Methods

These are the public methods:

Method set($cssInput)

$cssInput: string or array

It's used to set initial CSS. It can be used with an array of parsed CSS or the CSS code in a string, it will not append, it will replace the actual data.

You can use the set() method with string, this string could come from a file or whatever.

Output:

Or if you have an set of rules structured in an associative array, you can use that too:

Will output:


Method load($cssFilepath)

$cssFilepath: string with local path or remote URL to a CSS file

It's used load CSS from a file. The subsequently loaded files will be appended to the CSS already in the object.

Loading a CSS file from a local path:

Output:

Loading a CSS file from an URL:

Output:


Method save($cssFilepath)

$cssFilepath: string with pathname to the output file

It's used to save a file with the CSS defined in the object.

Saving into a file:


Method parse($cssStringInput)

$cssStringInput: string

Used to get a CSS in a string parsed into a set of rules in an associative array, to be manipulated and appended or prepended to the CSS later.

Example of parsing:

Output:


Method append($cssInput)

$cssInput: string or array

It's used to add CSS rules at the end of the CSS:

Output:


Method prepend($cssInput)

$cssInput: string or array

It's used to add CSS rules at the beginning of the CSS:

Output:


Method get($format='array',$minified=true)

$format: 'array', 'string' or 'json' $minified: true or false

It's used to get the CSS in the indicated format. The $minified attribute has no effect in the array format.

The default value of the get() parameter is 'array', so the return will be a set of associatives arrays:

Output:


If you need the CSS in a string you have to indicate the $format with the value 'string'

Output:


If you need the CSS in a string but not minified, you have to indicate the $minified atribute as false

Output:

You can also use it with the $format as 'json', but I think you kinda get it.

Configurations

Example:

Example of values not optimized:

After optimization:

If you need for for whatever reason disable the autoprefixer or the otimization, you can:



Tools

Running the tests

They are in the /tests/ folder. You can run them through a web browser or using the command line.

To use the through browser you need to navigate to domain.com/tests/ :D

For using the command line, you need a to have PHP installed and execute the file show_source.php passing the parameter f=filename.php.

Example:

Hi, my name is Igor Faria :D


All versions of css with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package csstool/css contains the following files

Loading the files please wait ....