Skip to content

Allow re-exporting of templates such as styled and css from internal files #851

@jpnelson

Description

@jpnelson

Describe the feature

We'd like to be able to re-export the css and styled template literals. Currently, the babel plugin will only detect and replace imports from the linaria library. This, for example, would not work:

./my-folder/linaria

export { css } from 'linaria';

./index.js

import { css } from './my-folder/linaria'

const className = css`
  background: red;
`

Since css is not being imported directly from linaria

Motivation

We have some linaria specific utilities (eg. shared styles and the like) that we house in a separate folder. It's a little cumbersome to also import the public API – if we could, we would re-export it from our internal folder to keep everything in one place.

Possible implementations

We could implement this either by adding logic to try to resolve the imports (might be tricky with custom configs) or to allow specifying which import paths may contain styled and css – I'd be happy to take direction on which of these is preferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: proposal 💬New feature proposal that needs to be discussedneeds: triage 🏷Issue needs to be checked and prioritized

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions