question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate components to styled-components

See original GitHub issue

Description:

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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
bcullmancommented, Jan 14, 2019

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.

  1. 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

  2. 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)

1reaction
magicmatatjahucommented, Jan 7, 2019

@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:

  • write always styled components in separate file, like a styled.js,
  • name styled components with prefix of appropriate component like ButtonContent ButtonWrapper etc.
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found