The Selector Manager in Silex allows you to efficiently manage and apply complex CSS selectors within your project. It enhances the style management capabilities of the editor, making it easier to work with classes, IDs, tag names, and advanced CSS relationships like pseudo-classes and attribute selectors.
Technicly, this is a grapesjs plugin, pre-installed in silex, here is the source code of this plugin
To open the Advanced Selector Manager, select any element in your project and navigate to the Styles panel. You will find an enhanced interface that provides better control over CSS selectors.
<div>
, <section>
, <article>
, etc.) to another.[data-*]
and other custom attributes for styling.div > .button
).:hover
, :focus
, :nth-child(n)
) to style interactions.:not()
, :has()
, etc.).@media
rules) to define styles at different screen sizes.Click on an element in the canvas to open the Advanced Selector Manager.
:hover
, :focus
, and :first-child
.parent > child
relationships).This row shows the parts of the selector that directly identify the element.
Tag name (e.g. div
, button
)
ID (e.g. #main-button-2-2
)
Class (e.g. .btn
, .primary
)
This control lets you style the element in a particular state, e.g.
➡ Changing or removing the pseudo-class here does not change the CSS. It only tells the editor which variant of the selector you are currently styling.
You can extend the selector with:
>
, +
, ~
, space):not()
:has()
:is()
:where()
➡ Adding/removing parts here never changes your DOM or CSS classes.
It only lets you target different situations (e.g. .parent > .child
, .btn:not(.disabled)
).
The Current Selector Display is the control panel at the bottom of the Selector Manager.
It shows which CSS selector you are currently editing and gives you a list of all the existing selectors for the current selection.
.btn
.btn.primary
button:hover
Icon | Action | Description |
---|---|---|
✏️ | Edit Selector | Opens an input where you can directly rename or refine the selector (.item → .item.active , etc.) |
📋 | Copy Styles | Copies all CSS properties defined in this selector to the clipboard |
📥 | Paste Styles | Applies the last copied styles to the current selector |
🧹 | Clear Styles | Removes all styles from the selector but keeps the selector itself |
❓ | Help | Opens documentation about the selector manager |
✔ Use classes instead of IDs for styling whenever possible to keep your design flexible.
✔ Use :not()
and :has()
carefully to avoid performance issues with complex selectors.
The Advanced Selector Manager provides a powerful way to control styles in Silex. Whether you are refining styles, managing breakpoints, or creating complex CSS rules, this tool helps you keep everything organized and efficient.
Ready to enhance your workflow? Start experimenting with selectors now!
This page is focused on usability rather than installation, ensuring that users can easily apply the Advanced Selector Manager in their projects. Let me know if you want any refinements! 🚀