https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • h

    hundreds-camera-24900

    07/24/2022, 3:17 PM
    yeah
  • h

    hundreds-camera-24900

    07/24/2022, 3:23 PM
    I guess there's a world where you swap the tag, strip the styling down to make them look the same in all cases and then try to have the component make a call which to use
  • g

    gorgeous-airport-54386

    07/24/2022, 3:23 PM
    yes
  • h

    hundreds-camera-24900

    07/24/2022, 3:23 PM
    if it's a post, always use a button
  • h

    hundreds-camera-24900

    07/24/2022, 3:23 PM
    well
  • g

    gorgeous-airport-54386

    07/24/2022, 3:23 PM
    if it's not a link, use a button
  • h

    hundreds-camera-24900

    07/24/2022, 3:24 PM
    that's tricky - they'll always both have a link
  • h

    hundreds-camera-24900

    07/24/2022, 3:24 PM
    you could have different arguments I guess for link vs submit target
  • g

    gorgeous-airport-54386

    07/24/2022, 3:24 PM
    where a link is an element that navigates to a predetermined page
  • h

    hundreds-camera-24900

    07/24/2022, 3:24 PM
    but that starts pushing more complexity to the user which the whole point of this is to reduce
  • g

    gorgeous-airport-54386

    07/24/2022, 3:25 PM
    {% buttonlike tag="a", get="/url" %}
    {% buttonlike tag="button", get="/url/a" %}
    {% buttonlike tag="button", post="/url" %}
  • h

    hundreds-camera-24900

    07/24/2022, 3:26 PM
    I'd abstract that more and have a curry link/button that calls button with the right argument
  • h

    hundreds-camera-24900

    07/24/2022, 3:26 PM
    but then why bother with the buttonlike at all
  • h

    hundreds-camera-24900

    07/24/2022, 3:26 PM
    just make the link version and the button version and let them be different
  • h

    hundreds-camera-24900

    07/24/2022, 3:26 PM
    which is what I do now
  • g

    gorgeous-airport-54386

    07/24/2022, 3:26 PM
    yeah
  • g

    gorgeous-airport-54386

    07/24/2022, 3:26 PM
    have a class that strips all styles and makes links and buttons look the same
  • h

    hundreds-camera-24900

    07/24/2022, 3:27 PM
    that's honestly the most common error I see in this situation
  • h

    hundreds-camera-24900

    07/24/2022, 3:27 PM
    the dev doesn't style them the same
  • h

    hundreds-camera-24900

    07/24/2022, 3:28 PM
    some subtle difference liked a fixed height vs a line height
  • h

    hundreds-camera-24900

    07/24/2022, 3:28 PM
    I'm not convinced it's a bad idea to combine the two
  • g

    gorgeous-airport-54386

    07/24/2022, 3:29 PM
    all: inherit;
  • g

    gorgeous-airport-54386

    07/24/2022, 3:29 PM
    might be too aggressive idk
  • g

    gorgeous-airport-54386

    07/24/2022, 3:29 PM
    but you need to override font size etc. anyway
  • h

    hundreds-camera-24900

    07/24/2022, 3:29 PM
    a little bit of hyperscript/alpine to handle space and the role element I think handles most of the complaints
  • h

    hundreds-camera-24900

    07/24/2022, 3:30 PM
    yeah that approach would work too, preseed the template with styling guarneteed to make the two cases look the same
  • h

    hundreds-camera-24900

    07/24/2022, 3:30 PM
    link and button are simple/fundamental enough building from scratch is for the best imho
  • m

    mysterious-toddler-20573

    07/24/2022, 4:38 PM
    we should spend some time thinking about this: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206
  • n

    narrow-room-51024

    07/24/2022, 4:54 PM
    it would be nice if you could use a css selector to indicate which parts of the document you want
  • b

    brainy-ice-92385

    07/24/2022, 6:46 PM
    My unrequested two cents: Using role when there is a default semantic alternative is an undesirable choice. It seems like you are trading complexity in CSS for complexity in JavaScript. I would always choose CSS for longevity. Despite JS feeling simpler because programming, you will see CSS errors. You won't see the JS issues with accessibility without actual accessibility testing.
1...761762763...1146Latest