Add Overflow to prop aliases
See original GitHub issueWhy:
Consider this common mobile layout:
const template = `
header
content
footer
`
const C = () => (
<Composition
template={template}
templateRows='auto 1fr auto'
height='100vh'>
{({ Header, Content, Footer }) => (
<>
<Header/>
<Content/>
<Footer/>
</>
)}
</Composition>
)
Now say we want the Content area to be vertically scrollable - this means that the Content div needs to have overflow-y: scroll
in it’s style.
Without top-level support for overflow we would need to apply the style inside the FaaC.
Why I think this is a good candidate: Quite simply - I believe scroll is a layout concern; it’s not styling.
How:
Add the following prop aliases to the Box component.
alias: overflowY
type: string
mapping: {
undefined: `overflow-y: auto`
[value]: `overflow-y: ${value}`
}
alias: overflowX
type: string
mapping: {
undefined: `overflow-x: auto`
[value]: `overflow-y: ${value}`
}
alias: overflow
type: string
mapping: {
undefined: `overflow: auto`
[value]: `overflow: ${value}`
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Add an alias for a property in JavaScript - Stack Overflow
defineProperty() method defines a new property directly on an object, or modifies an existing property on an object, and returns the object.
Read more >Why hooks are the best thing to happen to React
React hooks have made performing these functionalities much easier by providing an avenue for simpler, more composable, flexible, and extendable ...
Read more >The Most Asked TypeScript Questions on StackOverflow
Almost all features of an interface are available via type aliases, except you cannot add new properties to a type by re-declaring it....
Read more >CSS reference - CSS: Cascading Style Sheets - MDN Web Docs
Note: The property names in this index do not include the JavaScript names where they differ from the CSS standard names.
Read more >Dropdown | Components - BootstrapVue
<b-dropdown> (or known by its shorter alias of <b-dd> ) components are ... of the parent container too, add the w-100 utility class...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Glad that helped. I’m closing this issue in favor of #126.
overflow
CSS properties will be added as a part of pre-configured prop aliases packs once the referred API lands. Feel free to suggest more useful aliases in that issue.Thank you once more for contributing!
ahh that’s ideal, thanks - I hadn’t realised this was possible