Open rohiievych opened 3 years ago
I like StyleSheet and "CSS-like" styles generation in React Native. What do you think about it? I suppose it could be a great choice for your framework.
I like StyleSheet and "CSS-like" styles generation in React Native. What do you think about it? I suppose it could be a great choice for your framework.
We need a proprietary high level abstraction over css rules, so that it'll be easier to style elements with it.
We need a proprietary high level abstraction over css rules, so that it'll be easier to style elements with it.
For example?
We need a proprietary high level abstraction over css rules, so that it'll be easier to style elements with it.
For example?
Assume this pseudo code as style config example for particular element. We can also add some props to control surrounding element styles like next, prev, child, children, parent, etc. Using this config we can create a single rule for all elements of this type, i.e. share. Then encapsulate it with uniquely generated selector and output some valid css. Precompilation is also possible. In any case this approach is supposed to be 'css-in-js' like as we write it in js.
{
position: 'relative',
padding: '5px 10px',
borderRadius: '2px',
opacity: 0,
transition: 'opacity 0.2s ease',
hover: {
opacity: 1
},
after: {
content: '',
position: 'absolute',
top: 0,
left: 0,
width: '20px',
height: '20px'
}
}
Here is the first naive implementation of metacomponents (Proof of Concept). NEED DISCUSSION AND INVESTIGATION.
Key features:
Component button example:
TODO: