Download the PHP package alnaggar/php-css-builder without Composer

On this page you can find all versions of the php package alnaggar/php-css-builder. 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 php-css-builder

PhpCssBuilder

Latest Stable Version Total Downloads License

PHP CSS Builder allows you to programmatically generate CSS using a fluent, chainable API.

It supports:

[!WARNING] This package does not perform any form of sanitization, validation, escaping, or filtering of input values.

It is designed purely as a CSS construction and formatting tool and will output exactly what the developer provides.

All responsibility for security, correctness, and safety of the generated output lies with the developer using this package, especially when handling user-provided or untrusted data.

Table of Contents

Requirements

Installation

Install the package using Composer:

Usage & Architecture

This package is a programmatic CSS builder, not a parser, validator, or sanitizer. It allows you to compose CSS using PHP objects, mirroring the actual CSS grammar.

The design is intentionally split into small, focused classes, each representing a real CSS concept.

Core Concepts

  1. Every statement is a Cssable

    Every statement class implements the Cssable interface, meaning it can independently render CSS via toCss().

  2. CSS Is Built From Statements

    The package models CSS as a tree of statements.

    All CSS statements implement:

Statement Types

  1. CssRuleset (Selector Blocks)

    Represents a standard CSS selector block (e.g. :root, *::before, h1).

    Example:

    Outputs:

    Nesting support:

    A ruleset can nest:

    • Other rulesets

    • Block at-rules

    This allows output suitable for CSS preprocessors:

    Outputs:

  2. CssBlockAtRule

    Represents at-rules that contain blocks (e.g. @media, @supports, @layer, @page, @top-right).

    Example:

    Outputs:

    Nesting support:

    A block at-rule can nest:

    • Rulesets

    • Other block at-rules

    Example:

    Outputs:

  3. CssStatementAtRule (Single-Line At-Rules)

    Represents non-block at-rules (e.g. @import @charset @namespace).

    Example:

    Outputs:

Nestable Statements

Only statements that implement NestableCssStatement can be nested.

These are:

CssRuleset

CssBlockAtRule

This ensures:

EmbeddedCss (HTML <style> Container)

EmbeddedCss is the final output container.

It:

Complete Example:

Outputs:

Contributing

If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the GitHub repository.

Credits

License

PhpCssBuilder is open-sourced software licensed under the MIT license.


All versions of php-css-builder with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
ext-pcre Version *
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 alnaggar/php-css-builder contains the following files

Loading the files please wait ...