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.

Custom theme-based TypeScript Intellisense

See original GitHub issue

Another goal of this library is to have a script that detects your theme, and builds TypeScript intellisense into your components based on your custom theme values. But this isn’t made yet. I’d love help with it.

For example, if you have a theme like this:

export default {
  colors: {
    primary: 'blue',
    muted: '#e8e8e8',
  },
};

Then you would get intellisense like this:

^ The gif might take sec to load.

I think this could be achieved with some TypeScript wizardry, where a command line takes in the theme file and generates a typescript hidden file in your repository. This hidden file would globally declare values that override the sx prop, injecting in type suggestions. The command would probably be placed in a given project’s postinstall, so that it runs every time you run yarn or npm install

@slorber recommended I look here.

I think generating something like this would work?

Xiy9U6kv

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:26 (25 by maintainers)

github_iconTop GitHub Comments

2reactions
rafaelrinaldicommented, Oct 5, 2021

Popping in to say I thoroughly appreciate all the work being put into this. It will be such a great addition to Dripsy!

2reactions
nandorojocommented, Sep 28, 2021
Screen Shot 2021-09-28 at 6 08 16 PM

Props now narrow down to the specific themeKey for a given style 😎

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Custom theme-based TypeScript Intellisense -
Another goal of this library is to have a script that detects your theme, and builds TypeScript intellisense into your components based on...
Read more >
Theme with styled-components and Typescript - Medium
Having options to customize the look and feel of your app from the ... It will highlight and IntelliSense your syntax for styled-components ......
Read more >
TypeScript Programming with Visual Studio Code
VS Code provides IntelliSense for individual TypeScript files as well as TypeScript tsconfig.json projects. Hover information. Hover over a TypeScript symbol to ...
Read more >
TypeScript - Theme UI
The Theme type represents all possible themes. It might be what you need when you're writing a library of reusable components or an...
Read more >
Create a Custom Theme - Dripsy
You'll likely want to make a custom theme. ... it's worth pointing out that Dripsy has amazing TypeScript autocomplete based on your, unlike...
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