GithubHelp home page GithubHelp logo

Comments (5)

shawnbot avatar shawnbot commented on April 23, 2024

Maybe the <StyleProvider> introduced in #158 should be responsible for outputting the <link> tags as well? And maybe it could take a baseURL just in case folks aren't comfortable with linking to unpkg.com?

from react.

shawnbot avatar shawnbot commented on April 23, 2024

Okay, after hacking on this in #238 so that we can use Next's sass loader, I have some better-formed opinions on how this should be done. Here's a proposed plan:

  1. Introduce a <BaseCSS /> component that includes primer-base and whichever other styles we need to support existing components.
  2. As we factor out Primer CSS from components, we remove the imports and npm dependencies. (For instance, primer-labels goes away when we
  3. When we're done refactoring components, all that should remain is primer-base.
  4. Figure out how to implement style encapsulation correctly.
  5. Once styles are properly encapsulated and <BaseCSS /> is no longer needed, we make that component render null.
  6. Remove the <BaseCSS /> component in the next major release.

What do you think, @broccolini @emplums @jonrohan?

from react.

emplums avatar emplums commented on April 23, 2024

Curious what you were thinking for Figure out how to implement style encapsulation correctly. ? Does "styles are properly encapsulated" === using all CSS in JS or are you thinking about something else?

from react.

shawnbot avatar shawnbot commented on April 23, 2024

@emplums I honestly don't know. Like, should all our components have the default font-family and line-height? I don't know how total style encapsulation is really possible without doing that. Or do we add a component that inlines the base styles with <style scoped>? /cc @broccolini

from react.

shawnbot avatar shawnbot commented on April 23, 2024

Done in #260

from react.

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.