question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v4]: style handling proposal

See original GitHub issue

As we think about a move to v4 i’d like to simplify the way we handle theme variants, sizes and the like.

Right now we have a bunch of complexity around validating all these inputs. It’s a nicety but adds a bunch of complexity and confusion for folks who want to tweak stuff easily.

I propose that we take reactstrap’s approach here and have no specific propType validation for variants, styles, and styles, e.g

I also think that we should maybe take this time to rethink some of the names? maybe

  • bsStyle -> variant
  • bsClass -> variantPrefix (intentionally verbose, most ppl shouldn’t use it)
  • bsSize -> size (this is maybe problematic b/c of the ns conflict with html input size

This should help remove our dependency on runtime propType usage as well.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
jquensecommented, Mar 5, 2018

Ok current thinking:

we maintain the general bsClass, bsStyle, bsSize breakdown (but rename them to bootstrapPrefix, variant, and size). We worry a bit less about uniformity across all components, I don’t think it’s a big deal that things likes block or vertical are technically also variants but different props. There seem to be less of them in general in v4, delegating instead to util classes, anyway.

It’s not the “cleanest” but its more inline with how other frameworks handle this stuff, like material-ui@1 and a much easy migration path than cramming them into one. Plus it’s easier to add in validation for folks that want that, and works better for typing i think.

1reaction
taioncommented, Dec 6, 2017

@aaronbeall

The goal right now is to let people do stuff like <Button bsStyle="custom"> and get the class .btn-custom, or do something like <Button bsClass="my-btn" bsSize="large"> and get .my-btn-large.

I agree that, when working with stock TWBS, it’d be nice to have type checks on the values, but it is a goal here to support custom extensions of TWBS in a nice way, and it’s nice to have an easy way to follow the prefixed class name convention.

It’s not “pretending”, it’s extending the framework.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Big 4 Professional Services Style Tender / Proposal Template ...
Provides a template and guidance on how to develop a powerful tender, proposal and and bid for your business - to the quality...
Read more >
How to Format A Proposal : The Do's and Dont's | RFPIO
Double-spacing makes your proposal document much easier to skim. 4. DO insert paragraphs every 3-5 sentences. Always break up monolithic blocks of text,...
Read more >
How to Format a Business Proposal (With Examples)
What is the best proposal format? In this post we outline basic ... You may also be familiar with the style they find...
Read more >
New WixBA UI, v4 - WiX Toolset
The WiX Toolset setup's UI is authored using a 'Metro style' fixed dimension ... The proposal is to update the 'look and feel'...
Read more >
5-4 Submitting a Responsive Proposal - FDIC
Prepare an effective response to a Request for Proposal. ... that stands a much higher chance of success than a generic cookie-cutter-style proposal....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found