Blueprint: Feature Request: Default CSS class for fieldset/legend elements

Created on 10 Jan 2017  路  6Comments  路  Source: palantir/blueprint

If we wrap our beautiful blueprint-styled form elements with <fieldset> , it sticks out like a sore thumb.

Looking through the BP docs I don't see any CSS references for <fieldset> or <legend> elements, so I gather blueprint's CSS doesn't actually define anything for such elements.

So this is a request to give us a default fieldset/legend CSS class out of the box that we can use.

EDIT: Title and post edited for clarity

P2 core feature request help wanted

Most helpful comment

A .pt-fieldset class to remove default (edit: browser stylesheet) styling doesn't actually sound bad. I would prefer the behavior to be opt-in and as mentioned in #244, we should try to remove global styling rather than add it to Blueprint.

All 6 comments

We use heading tags to add a heading to a form group. If we were to style fieldset/legend, it'd look like just a heading (h4 or h5).

Do we want default styling for every HTML element? My hunch is no, but I'll let others chime in. https://github.com/palantir/blueprint/issues/244 may be related

image

_whoa._ I was gonna say something about "we're trying not to style HTML elements directly see #244" but this is truly unpleasant.

The HTML <fieldset> element is used to group several controls as well as labels (<label>) within a web form. MDN

Yup, and it'd seem silly to create a .pt-fieldset class just to remove default styling. But also as you said, we're trying not to style HTML elements directly (#244). What's a good solution then? 馃槸

well, simply adding class="pt-card" goes a long way towards making a fieldset attractive.

A .pt-fieldset class to remove default (edit: browser stylesheet) styling doesn't actually sound bad. I would prefer the behavior to be opt-in and as mentioned in #244, we should try to remove global styling rather than add it to Blueprint.

Just to clarify. By default styling I do mean something akin to a .pt-fieldset and not a global CSS rule for all fieldset/legend elements.

@giladgray If applying .pt-card on a fieldset is sufficient as you would suggest, then some mention/guidance in the docs about this would suffice. Anything so that a developer new to blueprint who adds a fieldset to group a set of blueprint-styled form elements does not have to ask the question: Why does my form look like $YOUR_ATTACHED_SCREENSHOT?

Was this page helpful?
0 / 5 - 0 ratings