Giter Site home page Giter Site logo

Comments (3)

joakin avatar joakin commented on August 22, 2024

It seems like the elm-canvas is not getting display:block and so it is not properly scaled so the css you apply to it looks strange.

From Custom Element Best Practices:

Custom elements are display: inline by default, so setting their width or height will have no effect. This often comes as a surprise to developers and may cause issues related to laying out the page. Unless you prefer an inline display, you should always set a default display value.

This works https://ellie-app.com/869YWKNhxtda1

And in the elm-canvas examples we use this snippet:

elm-canvas {
display: block;
background-color: white;
box-shadow: 0 0 200px rgba(0, 0, 0, 0.07);
}

If you can I'd be happy to take a PR that adds another note to toHtml and toHtmlWith briefly explaining the default display for the element.

Hope this helps πŸ‘†!

from elm-canvas.

CatrielD avatar CatrielD commented on August 22, 2024

Thanks for pointing me in the right direction!

I've used 'display: inline-flex' for proper display. Using block, has a minor "glitch": an inferior black border.

I've created a gitlab repo with the examples on the discourse page; feel free to use it anyway you wish, or not.

Ok, I'll make a PR.

from elm-canvas.

joakin avatar joakin commented on August 22, 2024

Thanks CatrielD, I'll look at it soon πŸ‘

from elm-canvas.

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.