Giter Club home page Giter Club logo

Comments (5)

matejlatin avatar matejlatin commented on May 18, 2024 1

Hey @zackphilipps thanks I think this could be something to look into for the next major update. Not sure when though... :(

from gutenberg.

 avatar commented on May 18, 2024

I think the root of the issue is more about design theory than the actual JS function.

So I think the question should be: Is necessary to make everything follow a vertical grid on the web?

In print is a common practice but is also a static medium, and the web is an incredibly dynamic place, so is almost impossible to get that right. Also, let's consider that this is a generic library, so is impossible to know the exact use cases for everybody.

So I think the right way to handle vertical rhythm on the web is to not worry too much about element heights, only about elements spacing. In this case, we get to the simplest scenario where we don't have to deal with setting the right height for images (potentially getting distortion), for example, but this can also be applied to other tricky elements like dynamic heading sizes.

By getting consistent spacing on the elements we already get a good visual result, aligning everything to a grid is not important, nobody would notice it unless the lines of a grid are present.

I hope this all makes sense. What I'm saying is just a constructive critic, I also had to manage this stuff with Concise CSS and this is the route I took. I also created a lh unit for this same reason: https://github.com/KolceThompsonCo/postcss-lh and with it I just write how many "grid rows" of spacing I want for a certain element, without worrying about anything else.

What do you think @matejlatin?

from gutenberg.

matejlatin avatar matejlatin commented on May 18, 2024

Hey @jameskolce yes that was my original thought as well and I think I even wrote somewhere in the instructions that people shouldn't obsess too much with the height of the images. There should be a simple way to either enable or disable this JS fix but for the presentation purposes I left it in... might remove it in the future and only keep it in the examples.

from gutenberg.

 avatar commented on May 18, 2024

I can check a way to enable/disable it easily this afternoon, will let you know if I get something!

from gutenberg.

 avatar commented on May 18, 2024

So I just checked and I think the way to do it with minimal changes is just to add a global variable like var autofixImgHeight = false, and check for its value before calling the fixImgHeight function. Though splitting everything into a function an pass a configuration object would be a better solution.

from gutenberg.

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.