I'm developing a Chrome extension so I can use bleeding-edge technologies like flexbox:
HTML:
<label for="example-search">Classic search example</label>
<div class="input-wrapper">
<input type="text" id="example-search" />
<button>Search</button>
</div>
CSS (cleared to highlight flexbox):
.input-wrapper {
display: flex;
flex-flow: row nowrap;
}
.input-wrapper > input {
flex: 1 1 auto;
}
.input-wrapper > button {
flex-shrink: 0;
}
I have two questions:
- Is this the right way to work with flexbox?
- Is there is a way to gracefully degrade this to use in websites?
Using flexbox for production:
I recently found a great article about my issue: flexbox in the real world
Raw insigsts from atricle:
- use autoprefixer to support all old desktop and mobile browsers (they use old flexbox model syntax)
- use progressive enhancement for IE8- (see Scenario 3 from article)