Giter Club home page Giter Club logo

Comments (3)

artf avatar artf commented on June 12, 2024 1

it is intended to store canvas styles, styles that do not affect the result of hmtl/css, styles that will not be exported, right?

Correct

by default the body has a white background, this seems to be the default color in all browsers, no?

yeah but the iframe body doesn't have any default background color that's why that style is there, so you'll need to figure it something for your use case.

from grapesjs.

artf avatar artf commented on June 12, 2024

There is canvasCss option for that.

Next time open a Discussion please, as this is not a core bug but wrong usage.

from grapesjs.

ctrhub avatar ctrhub commented on June 12, 2024

Hey @artf. Thanks for the answer. I'm not sure that we understood each other and I would like to clarify one detail.
Yes, I know about the canvasCss property, moreover, I use it to change the styles of the selected component. I understand the essence of the property: it is intended to store canvas styles, styles that do not affect the result of hmtl/css, styles that will not be exported, right?
Then why do the default canvas styles have this CSS rule body { background-color: white; } ? And why it makes sense us to override it?
I understand the case where the body element is selected, in which case it makes sense to apply some styles to the body for interactivity.
But why specify body {background-color: white; } by default, it doesnโ€™t affect the interactivity of the editor?
Moreover, by default the body has a white background, this seems to be the default color in all browsers, no?
This is kind of unexpected behavior that requires me to apply !important to my exported style so that I can override the styles from canvasCss.

from grapesjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.