BUG: gjs-selected Style is Hardcoded
Question
This definition:
is always appended to the frame. It contains the color definition for selected elements (that blue outline). This color cannot be changed, because there's an !important here. Since this is appended to the body, adding a stylesheet in the header does not override it, even when I use !important there as well.
For my use case, the critical issue is that I want to be able to print the document created in grapesjs, but printouts should not contain the selection outline. I can write @media print { .gjs-selected { outline: none !important; } }, but that won't do anything since it's overridden by this hardcoded css definition.
Also, being able to change the color to fit the page's corporate identity would be good.
Answers (3)
Hi @anlumo you're right, unfortunately, component status styles are rendered inside iframes. I've tried to put them outside by introducing this option but that doesn't handle multiple selections yet. So, at the moment, the only way to handle them properly is to use this option:
grapesjs.init({
// ...
canvasCss: `
.gjs-selected {
outline: 3px solid red !important;
}
`,
})
Hi @mingxin-yang i belive that you have to follow the same rule that @artf said. But using the corresponding classes
grapesjs.init({
// ...
canvasCss: `
.gjs-tools .gjs-badge { /* for the label */
background-color: red;
}
.gjs-toolbar { /* for the toolbar */
background-color: red;
}
`,
})
Posted Free plugin for set colors
Borders: https://gjs.market/products/borders-color-around-selected-component
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3463
BUG: inspector overflow broken
WARNING READ and FOLLOW next 3 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grape...
Issue #590
How to overwrite domain_abstract ui Input component?
https://github.com/artf/grapesjs/blob/25fdbe14098c7e1a65d3e5527749302174f56a7d/src/domainabstract/ui/Input.js I want to change the input cl...
Issue #1615
[Feature] support edit credentials request attribute on Remote Storage
The credentials options its forced to be 'include' on Remote Storage. https://github.com/artf/grapesjs/blob/master/src/storage_manager/mode...
Issue #3152
BUG: the blue outline (gjs-hovered) is not following its parent during scrolling
Version: 16.27 Are you able to reproduce the bug from the demo? [x ] Yes [ ] No Describe the bug: I discovered an issue with gjs-hovered, t...
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.