I'm new to react and I build my applications with :
create-react-app applicationame --scripts-version=react-scripts-ts
I don't use webpack because create-react-app does all for me, and I think it's just fine !
Of course I need a toolbox for smart components. Thanks for Palantir to provide such a good library for free. Blueprintjs works well with React/Typescript, [even if many classes are still not created in typescript (ex:I must use <ul> for "pt-breadcrumbs" while class Breadcrumb is provided for "pt-breadcrumb"). But apart from that the toolbox is all right.]
Now I want to customize the look&feel of the application, to meet my customer's constraint :
- background and text color
- rounded corner or not
- font family and size
- icon list
- padding of components
- transition delays
- etc.
I found nowhere a documentation to customize all this. (looking in docs, in github, making lots of googling and search in stackoverflow)
- should I add a css file in my project and override blueprintjs classes ?
- can I compose a "theme" outside of my project, and copy it in some different projets ? (like I used to do with jqueryui)
- can I do this without using webpack ? (I find this tool much too complicated)
Thanks for your help.
So the easiest way would be to pass in your custom style via React's Component Styles.
Let's say we want to change the font-size and color of the text within the
<Button>
component.We first declare our style:
And then within the React classes
render()
pass in that new style to your<Button>
component: