PHPackages                             agencenous/blocss - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. agencenous/blocss

ActiveWordpress-package[Utility &amp; Helpers](/categories/utility)

agencenous/blocss
=================

CSS editor for elements in Wordpress blocks

0.3.3(3w ago)0136[2 PRs](https://github.com/agencenous/blocss/pulls)GPL-3.0-or-laterJavaScriptCI passing

Since Nov 27Pushed 3w agoCompare

[ Source](https://github.com/agencenous/blocss)[ Packagist](https://packagist.org/packages/agencenous/blocss)[ RSS](/packages/agencenous-blocss/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (1)Versions (13)Used By (0)

Blocss
======

[](#blocss)

Two in one CSS editor for elements in Wordpress blocks.

- The `@agencenous/blocss` NPM library to use in block editor
- The `agencenous/blocss` Composer library to use in the PHP callback function

Frontend
--------

[](#frontend)

You can add style attributes to your blocks. It will allow editors to apply style in the editor UI.

Add the depency:

```
npm install @agencenous/blocss
```

Just add attributes in the `block.json` file. If you need to manage many styles, no pronlem, you can add as many attributes as you need.

```
{
    "attributes": {
        "boxStyle":  {
            "type": "object",
            "default": {
                "fontSize": "1em",
                "backgroudColor": "#ff0000"
            }
        },
        "itemStyle":  {
            "type": "object",
            "default": {
                "fontSize": "1em",
                "color": "#ffffff"
            }
        }
    }
}
```

In the editor, use the **npm** library

```
const { InspectorControls, useBlockProps } = wp.blockEditor;
import { PanelBody } from '@wordpress/components';
import { StyleControl } from '@agencenous/blocss';

const blockProps = useBlockProps();
const {
    boxStyle,
    itemStyle,
    } = attributes;

const edit = ({ setAttributes, attributes }) => {
    return (

                     setAttributes({ boxStyle: value })}
                    />

                     setAttributes({ itemStyle: value })}
                    />

)};
```

Backend
-------

[](#backend)

In the callback, use the **composer** library

```
composer install agencenous/blocss
```

```
function myblock_render_callback($attributes) {
    $block_id = 'my-block-' . uniqid();
    $css_rules = [
        '.my-block' => $attributes['boxStyle'],
        '.my-block .block-item' => $attributes['itemStyle'],
    ];
    return '
        My block
        Item 1
        Item 2
    '.Blocss\inline_styles($css_rules, '#' . $block_id);
}
```

###  Health Score

38

—

LowBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 92% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Recently: every ~20 days

Total

7

Last Release

26d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/711568ddabbb0c5607b7bc77660a2094b8f32514d4a2bafcd2f8bba7caefb4d7?d=identicon)[bastienho](/maintainers/bastienho)

---

Top Contributors

[![bastienho](https://avatars.githubusercontent.com/u/2409849?v=4)](https://github.com/bastienho "bastienho (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")

### Embed Badge

![Health badge](/badges/agencenous-blocss/health.svg)

```
[![Health](https://phpackages.com/badges/agencenous-blocss/health.svg)](https://phpackages.com/packages/agencenous-blocss)
```

###  Alternatives

[malukenho/speaknumber

Transcreve números para extenso.

2957.3k](/packages/malukenho-speaknumber)[imi/magento2-store-switch-all-store-views

This module makes all store views available in the store switcher, regardless of their store or website.

1824.2k](/packages/imi-magento2-store-switch-all-store-views)[xu42/open-sdk

有赞云服务端SDK

214.0k](/packages/xu42-open-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
