Migrate components to styled-components
See original GitHub issueDescription:
- refactor all components to styled-components with https://github.com/styled-components/styled-components
- each component should have
theme
prop where you can pass your custom component theme: https://www.styled-components.com/docs/advanced#the-theme-prop
Reason:
When building an application you might need to use only few components and instead of including globally a stylesheet with styles for the whole components library doesn’t make sense.
- As an App developer you want to have components that are
self-contained
and bring styling with them. - As an App developer you want to have control over a component and override it’s styling in highly flexible fashion
Hint To quickly check how styled-components work take a look on one of ours component https://github.com/asyncapi/asyncapi-react and quickly play with it https://codesandbox.io/s/5vz8l9zlmn to see how theming works and that in case of styled-component for global stylesheet you need only a font reference
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:14 (5 by maintainers)
Top Results From Across the Web
FAQs - styled-components
Integrating an existing CSS framework with styled-components is really easy! You can use its existing class names alongside your components. For example, ...
Read more >Migrating to styled-components cheatsheet
I've recently migrated a project from vanilla CSS to styled-components to get myself more familar with the library and made a list of...
Read more >How we migrated 541 components from Styled ... - Storybook
From Styled Components to Emotion The good news was that Emotion and Styled Components have converged on a common API. That means most...
Read more >Migrate from styled-components - xstyled
A utility-first CSS-in-JS framework built for React.
Read more >Migrating to v5 - Styled System
Replace existing prop type definitions in your components with prop types from the new package. import styled from 'styled-components' import { color, space...
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 Free
Top 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
It looks like for this item, style would be served directly from this repo. I think we need to decide NOW what our relationship is with https://github.com/SAP/fundamental.
reference https://github.com/SAP/fundamental is what we should aspire to, but each fundamental-[X] repos (react/vue/ngx) is free to write their own CSS
dependency use CSS from https://github.com/SAP/fundamental directly, all fundamental-[X] repos (react/vue/ngx) are required to emit the same HTML, but left to their implement in the manner best suited to that framework.
Personally, I vote for dependency.
Additionally, during transition, SAP Concur will require the ability to use these components “style-less” (we will provide our own style)
@derberg The styles downloaded from the package is a good option. At the moment I do not have any better solution.
A few comments regarding writing styled components:
styled.js
,ButtonContent
ButtonWrapper
etc.