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.

Feature request: exported internal styles

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior/Context

As far as I’m aware (and I could be wrong), there is no way to get to the internal styles object of a component. For example, for <Input>s, I’d like to grab the underline class and use it in an external custom component.

Desired Behavior/Proposal

I’d like to propose that the styles object/function become a property on the component class so that it is available externally.

For example:

const styles = theme => {/* ... */};

class Input extends React.Component {
  // ...
}

Input.styles = styles;

Concerns

Exporting the styles of a component technically means that changing the style object is a breaking change. Maybe instead of Input.__styles could be used instead of Input.styles to let devs know it might lead to breaking changes if you didn’t want to be strict about it.

Let me know what you guys think. I’d like to use the internal styles over copying and pasting.

Thanks for the great library!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
eps1loncommented, Mar 15, 2019

@ricokahler Always try to include a specific use case. While it’s tempting to just look into the source and say what you want it makes it very difficult for us to find a good solution.

If somebody can provide a concrete use case I’m happy to reopen. I’m closing until then since the author has no use for this anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Export SVG With Inline Styles - Adobe XD: Feature Requests
Solution: Remove classes and generate inline styles for each SVG element (image 2).
Read more >
How can we export full HTML with styles? #5925
Unfortunately, it's not possible to receive HTML with inline styles. We have an open feature request for it - #1627.
Read more >
Latest Feature Requests topics
Feature Requests ; AnyType switches to light theme when print dialogue is active · Feature Requests · Export-Import-and-Print , Design-or-UI , Acknowledged. 8 ......
Read more >
Export merge requests to CSV - GitLab Docs
To export merge requests to a CSV file: On the top bar, select Main menu > Projects and find your project. On the...
Read more >
Use advanced book creation options in Pages
These features from your Pages document are exported to EPUB with ... objects are exported as floating (instead of converting to inline like ......
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