Git Product home page Git Product logo

Comments (2)

gouch avatar gouch commented on June 22, 2024

Text is the default type for inputs, so if the type attribute is missing or if it's an unknown value browsers treat it as a text input (that's why new HTML5 inputs still work in older browsers). So, yes, you're right that that both your input examples should look the same.

The current selector in base.css that styles text inputs is input[type="text"]. That doesn't match your first example because your input doesn't have the type explicitly set. The way to style your first example is to add a css selector for inputs without a type attribute: input:not([type]). Adding that to the list of selectors fixes the issue in all modern browsers... except IE 8 and below, which don't support :not().

It would be an improvement to add the selector even without IE 8 support, except it will break all other input styles in IE 8 because browsers have to skip the whole block of styles if they don't understand every selector in a list.

Too get around that the input:not([type]) selector would have to be put on its own line, and all the styles copy pasted in, which is code duplication, which is annoying – but so is the missing styling. dhgamache will have to decide which annoyance he dislikes more.

Edit: Another solution could be to give the text input styles to bare input and then override them with explicit input[type=foo] rules for checkboxes, radios, and submit buttons.

from skeleton.

dhg avatar dhg commented on June 22, 2024

After a bit of deliberation, I have decided to leave the inputs as they are for now, but I have considered all the proposed solutions here. I really encourage an explicit declaration for type on inputs, but if this comes up in the future, I may reconsider. Closing this for now, but will keep it on my list for potential future changes.

If you have any concerns or questions hit me up at [email protected]

from skeleton.

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.