# Styles Handler

[The styles handler](https://github.com/deep-web-solutions/wordpress-framework-utilities/blob/master/src/includes/Assets/Handlers/StylesHandler.php) exposes the following public methods:

* `register_public_style` for adding a style to the internal frontend registration queue
* `deregister_public_style` for removing a style from the internal frontend registration queue
* `enqueue_public_style` for adding a style to the internal frontend enqueueing queue
* `dequeue_public_style` for removing a style from the internal frontend enqueueing queue
* `register_admin_style` for adding a style to the internal admin-side registration queue
* `deregister_admin_style` for removing a style from the internal admin-side registration queue
* `enqueue_admin_style` for adding a style to the internal admin-side enqueueing queue
* `dequeue_admin_style` for removing a style from the internal admin-side enqueueing queue
* `add_inline_style` for registering a CSS string to be outputted before or after another enqueued file

The methods follow almost 1-to-1 the WP scripts API, in particular the [`wp_register_style`](https://developer.wordpress.org/reference/functions/wp_register_style/) function, the [`wp_enqueue_style`](https://developer.wordpress.org/reference/functions/wp_enqueue_style/) function, and the [`wp_add_inline_style`](https://developer.wordpress.org/reference/functions/wp_add_inline_style/) function.

{% hint style="info" %}
The `register_admin_style` and `enqueue_admin_style` methods accept a specialized argument `$hook_suffixes`. By default it's `null`, but it can be set to an array to conditionally register/enqueue the scripts only when the global variable `$hook_suffix` is set to one of the values.
{% endhint %}

As mentioned on the [Assets Service](/utilities-module/assets-service.md) page, the handler will automatically attempt to register/enqueue the minified version of your script (if it exists in the same folder and has the `.min.css` extension) and will attempt to set the file version to the result of the PHP `filemtime` function.

{% hint style="info" %}
For assets being loaded from an external URL, the `$fallback_version` argument will be used by default instead of trying to call `filmemtime` on the script.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://framework.deep-web-solutions.com/utilities-module/assets-service/styles-handler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
