Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input without type attr #31

Closed
zanona opened this issue Jul 29, 2011 · 2 comments
Closed

input without type attr #31

zanona opened this issue Jul 29, 2011 · 2 comments

Comments

@zanona
Copy link

zanona commented Jul 29, 2011

Hi,
first I would like to say thanks and congratulations for the great job with skeleton.

I am not sure if this is pertinent but if you declare this

<input name='firstname'>

It seems skeleton renders it differently than

<input name='firstname' type='text'>

I am not sure but as far as I know in html5, the type attribute defaults to text when ommited, so perhaps it should render as such?

Thanks.

@gouch
Copy link

gouch commented Aug 2, 2011

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.

@dhg
Copy link
Owner

dhg commented Aug 18, 2011

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 hi@getskeleton.com

@dhg dhg closed this as completed Aug 18, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants