CSS finally adds vertical centering in 2024 - eviltoast
  • refalo@programming.dev
    link
    fedilink
    arrow-up
    52
    arrow-down
    4
    ·
    4 months ago

    Is it just me or is the irony lost on the author? It says “align-content: center” but it’s only vertically aligned…

  • PunchingWood@lemmy.world
    link
    fedilink
    arrow-up
    31
    arrow-down
    1
    ·
    4 months ago

    Well that came like 10 years too late lol

    I don’t think I’ll ever use it considering it was already easily possible with flexbox, and before that (although dirtier) with tables as well.

  • cley_faye@lemmy.world
    link
    fedilink
    arrow-up
    20
    arrow-down
    1
    ·
    4 months ago

    Well, we’ve been vertically centring content with no-trick pure CSS for years now, so, good I guess?

    • lud@lemm.ee
      link
      fedilink
      arrow-up
      4
      ·
      4 months ago

      no-trick pure CSS

      What do you mean? How else would you center content without CSS?

      • cley_faye@lemmy.world
        link
        fedilink
        arrow-up
        17
        ·
        4 months ago

        There were tons of options with multiple HTML elements with a sequence of CSS properties to reliably provide vertical centering (and also use vertical space at the same time) back in the days.

        Now, between flex and grid (mainly flex for me, I find them more convenient) all the HTML scaffolding we used to make this work can be removed to get the same result. That’s what I mean with “no trick”.

        • lud@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          Oh, I thought you meant you were centering in some special way.

  • Lemminary@lemmy.world
    link
    fedilink
    arrow-up
    12
    arrow-down
    10
    ·
    edit-2
    4 months ago

    Can we not do away with CSS/JS, learn from those mistakes and try something else? Pls, I beg you 🥺🙏

    E: Sorry, forgot the /j Lighten up, Lemmy, not everything is a serious comment that needs your scrutiny or meticulous rebuttals.

    • Olap@lemmy.world
      link
      fedilink
      arrow-up
      9
      arrow-down
      1
      ·
      4 months ago

      What would you replace it with? There are lessons to be learnt from the web, but to “fix” it is much harder

    • yogsototh@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      4 months ago

      The first pass of elm ecosystem solved it. Before elm, it was also solved by other frameworks. But people wanted to be able to reuse their components and not rebuild new ones. React provided the ability to reuse css, and dirty js code in the middle of your application. You already had an way bigger ecosystem because you didn’t have to learn and built a complete new system again.

      Personally if I had the choice I believe a new start should start at the browser level. Stop supporting HTML/CSS/JS. Create a new app-centric DSL and not a document centric one like html/css/js.

      Ideally something inspired from cocoa layout. And I am dreaming but not accept generic code on the client side and only support a small controlled API. It would solve so many security issues. Sure, the creativity in such an ecosystem will be severely reduced. But we will have a so much improved UX.

      • pixel_prophet@lemm.ee
        link
        fedilink
        arrow-up
        6
        arrow-down
        1
        ·
        4 months ago

        I get the reasoning but anything like that would just be abused to enshittify things further with unblockable ads and enforced DRM on everything. At least with the open standards there is the ability to adblock and manipulate certain annoyances at a browser level

  • katy ✨@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    3
    arrow-down
    13
    ·
    4 months ago

    i did valign years ago. /s

    also i think more needs to be said about a push to localise css (and html, really). the fact that it still requires programmers to be versed in english is pretty sad.

    • GetOffMyLan@programming.dev
      link
      fedilink
      arrow-up
      14
      ·
      4 months ago

      English is the most spoken language outside of its home country and it uses the simplest alphabet.

      It is a pretty sane choice.

      You could write yourself a nice preprocessor

      • addie@feddit.uk
        link
        fedilink
        arrow-up
        6
        ·
        4 months ago

        It’s a simple alphabet for computing because most of the early developers of computing developed using it and therefore it’s supported everywhere. If the Vikings had developed early computers then we could use the 24 futhark runes, wouldn’t have upper and lower case to worry about, and you wouldn’t need to render curves in fonts because it’s all straight lines.

        But yeah, agreed. Very widely spoken. But don’t translate programming languages automatically; VBA does that for keywords and it’s an utter nightmare.

        • DaPorkchop_@lemmy.ml
          link
          fedilink
          arrow-up
          3
          ·
          4 months ago

          Or worse, Excel, which translates the function names but doesn’t do it automatically, so you can only open a spreadsheet if your Excel is configured to the same language as the spreadsheet was created in.

    • Kissaki@programming.dev
      link
      fedilink
      English
      arrow-up
      8
      ·
      4 months ago

      English source code is a universal language.

      I’ve never seen a need for localization beyond domain terminology. And I think it would be a huge detrimental.

      To implement it would be unnecessary significant complexity. Effort better spent elsewhere. And for programmers it’d be confusing. Think code snippets, mixing content, and the need for reserved word expansion or exclusive parsing scopes that would be even more complex and confusing.