GithubHelp home page GithubHelp logo

Using 2.0.0-17 of styled-components doesn't correctly extract styles for extended classes serverside about babel-plugin-styled-components HOT 6 CLOSED

styled-components avatar styled-components commented on May 4, 2024
Using 2.0.0-17 of styled-components doesn't correctly extract styles for extended classes serverside

from babel-plugin-styled-components.

Comments (6)

romellogoodman avatar romellogoodman commented on May 4, 2024 1

Closing. I am no longer seeing this issue in 2.2.0

from babel-plugin-styled-components.

kitten avatar kitten commented on May 4, 2024

Styles aren't extracted by this plugin at all. This is a work in progress. 😉

from babel-plugin-styled-components.

mxstbr avatar mxstbr commented on May 4, 2024

The color and font-size rules are split into two different classes but only the color class is sent from the server. When the page renders styled-components correctly renders both styles.

That's still a bug I'm pretty sure?

from babel-plugin-styled-components.

kitten avatar kitten commented on May 4, 2024

@mxstbr Could be? 🤔

@romellogood Can you post your code before and after transpilation?

from babel-plugin-styled-components.

romellogoodman avatar romellogoodman commented on May 4, 2024
<p class="fwwwt4-0 XtIyK s1tqgosa-0 hFCZie" data-reactid="5">WELCOME TO THE HOME PAGE</p>

.XtIyK {
    color: #0DA548;
}

.fwwwt4-0 {
}

.hFCZie {
    font-size: 24px;
}

.s1tqgosa-0 {
}

.XtIyK {
    color: #0DA548;
}

Here is the transpired code for the snippet above. This is after the client takes over and correctly adds the font-size 24px.

I beginning to think the issue may be with ServerStyleSheet generating the css on the server instead of the plugin.

from babel-plugin-styled-components.

kitten avatar kitten commented on May 4, 2024

Can you post the transpiled JS code of your example above, after it's gone through babel, so we can see if it's a problem with styled-components or our babel plugin? 😄

Cheers 😉

from babel-plugin-styled-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.