-
Notifications
You must be signed in to change notification settings - Fork 10
Extending styling while using CSS Modules #178
Comments
|
|
example of |
@mAiNiNfEcTiOn: they are separate. Issue #153 is about using This issue is a feature request for the Components (JS) in UI-Kit. |
so, any thoughts how can we prevent inconsistency of UI when we introduce |
enabling but with CSS Modules and if there happens to be inconsistencies, manual reviews would be needed. I suggest establishing something like design guidelines for Travix, like how Ant Design does here for example: https://ant.design/docs/spec/introduce Enable developers to do things. But guide them about what to do, and especially what not to do. |
Here is the case: I'm working on seatmap widget right now. I have HTML structure built by amadeus script, that structure contains static CSS classes what I need to style. What if we allow using global css class names only inside of generated ones? So we will be sure that we are override/extend only content inside of our parent (widget/block). |
I agree with @fahad19, exposing Also, I would add that:
// this would be ok:
render() {
const { className } = this.props;
return (
<div className={className}>
bla
</div>
);
}
// or...
import SubComponent from './SubComponent'; // and internally this would behave as the previous example
/*...*/
render() {
const { className } = this.props;
return (
<div>
<SubComponent className={className} />
</div>
);
}
// this would NOT be ok
render() {
const { className } = this.props;
return (
<div>
<div className="other-stuff">
<h3 className={className}>Bla</h3>
</div>
</div>
);
} If you have the need to have a className in an inner element generated by you, either extract it as a component to pass the attribute (which in this last case would make no sense to do an H3 component, so just do proper CSS :D) |
So, guys, you're not even considering that you may not need The idea is to have standard UI. If you need to customize it — add it to UI kit, so other developers will be able to reuse it. Or talk to designers and change the design to use components from the library. If even this is not the case — you may not need UI kit at all for your component. Let's wait for @iwwwi before taking action on this |
@asci sure... still some discussion never harmed anyone. Can you elaborate more on the
? Since we're discussing the possibility of using CSS Modules on UI Kit, using |
@mAiNiNfEcTiOn
I tried to elaborate on this in my message |
Browsers and versions affected
n/a
Description
The problem
:global
featurePossible solution
One way we can enable this while both maintaining CSS Modules and allowing developers to extend the UI-Kit Components in their Apps is by supporting a
className
prop in all UI-Kit components.And the styles in a CSS Module can be:
Steps to reproduce
:global
disabled)Expected results
Being able to extend the styling of UI-Kit components shouldn't require knowing the CSS class names used by the Components internally.
And developers should be allowed to do so without being able to modify the styling of UI-Kit elsewhere. Only their own Apps are affected by their own code.
Actual results
n/a
The text was updated successfully, but these errors were encountered: