No CSS ::before & ::after Selectors
Question
how can we add before and after selector for any classes
Answers (1)
You have to change selector states
grapesjs.init({
...
selectorManager: {
states: [
{ name: 'hover', label: 'Hover' },
{ name: 'nth-of-type(2n)', label: 'Even/Odd' },
{ name: ':before', label: 'Before' },
{ name: ':after', label: 'After' },
],
}
})
Related Questions and Answers
Continue research with similar issue discussions.
Issue #6152
BUG: CSS added via custom code persists after custom code component is removed
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? any Reproducible demo link https://grapesj...
Issue #2211
[QUESTIONS] How to set style for pseudo elements (:after and :before)
Hi, I add STATE in style manager :before and :after but all the styles are applied to the component.
Issue #4411
BUG: XSS when add class name to Selector Manager
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v102 Reproducible demo link https:/...
Issue #4310
BUG: Style Manager is inaccurate when using combined CSS selectors which contains "bout" and componentFirst = true
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 100 Reproducible demo link https://...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.