Giter Site home page Giter Site logo

Comments (3)

claviska avatar claviska commented on May 2, 2024

The docs are generated from markdown, so the <p> tags are added during that conversion. The proper way to space form controls and labels is with an input field:

<div class="input-field">
  <span class="switch">...</span>
</div>

For best results, a switch should always be a <span> and never a <div>.

from shoelace.

nevf avatar nevf commented on May 2, 2024

@claviska

For best results, a switch should always be a <span> and never a <div>.

Can you explain why a <div> should never be used? With the small changes I outlined it seems to work wonderfully well.

IMO using a <div> is much clearer semantically. Also having to wrap the <span switch> in an <div class="input-field"> adds unnecessary extra markup which isn't semantic. ie. I don't consider a switch to be an input field.

from shoelace.

claviska avatar claviska commented on May 2, 2024

Because the control is intended to be structured as a span. By changing it to a div, you've demonstrated yourself why the it shouldn't be modified. As-is, you can use it inline or in an input field like other elements.

I don't consider a switch to be an input field.

It's just another way to style a checkbox, so definitely an input :)

from shoelace.

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.