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.

Change Style import to import directly from @compiled/style

See original GitHub issue

It means for people who can’t rely on treeshaking they still get the smallest bundle size. We can also potentially be in trouble for name clashes, so throw an underscore in there for good measure.

Before

import { Style } from '@compiled/css-in-js';

After

import _Styl from '@compiled/style';

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
itsdougescommented, Apr 29, 2020

O DAM HES JUMPIN IN cc @danieldelcore look at him go

yeah exactly! this will be a good issue to work on to familiarize you with typescript transformers too.

one nuance will be needing to ensure @compiled/css-in-js import gets removed - which means every api transformer needs to check “am i the last compiled import” and then when they remove themselves - they also remove the entire import declaration

you can see the current logic inside packages/ts-transform/src/utils/visit-source-file-ensure-style-import.tsx

0reactions
itsdougescommented, May 1, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

import - CSS: Cascading Style Sheets - MDN Web Docs
The @import CSS at-rule is used to import style rules from other valid stylesheets. An @import rule must be defined at the top...
Read more >
React Native - Change component style after import
I'm wondering if there is anyway to change a component style after importing it. Let's say I created a button component that has...
Read more >
Using CSS Module Scripts to import stylesheets - web.dev
With the new CSS module scripts feature, you can load CSS style sheets with import statements, just like JavaScript modules.
Read more >
XslCompiledTransform.Load Method (System.Xml.Xsl)
Loads and compiles the XSLT style sheet specified by the URI. The XmlResolver resolves any XSLT import or include elements and the XSLT...
Read more >
styleq/README.md at main - GitHub
Supports various CSS compiler designs. 0.7 KB gzipped runtime. Use. Install: npm install styleq. Import: import ...
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