Giter VIP home page Giter VIP logo

Comments (3)

zoy-l avatar zoy-l commented on May 27, 2024
  1. The React server component may not be able to reply to you for the time being. I don’t know much about it at the moment. The current result does not support it. need to try
  2. createSystem is the solution I don't want to write type... roughly where themes and utilities are created
  • Different styles are created only once and depend on theme patterns rather than CSS rule keys. In theory, there is only a certain performance overhead during initialization, so after the first creation is completed, subsequent style changes (initializing past theme changes) will only change the className or style, and will not parse CSS rules again
  • not depend on react lifecycle creation rules. theoretically the theme does not use var, It's okay, it is safe to use ':xxx-child'
  • don't need to write rules like (...) (size === 'xxx' && {})) and rules like shouldForwardProp (3-2)
  • Passing values ​​through props, I think this is a trap written. Multiple choices can confuse people. Not everyone understands the logic behind whether to use style or prop. Using prop directly will generate a large number of roughly the same CSS rules. Passing a value is a state change that can be resolved with variants. Values ​​that need to change frequently should use vars or style, clearer division of duties
  1. yes, I will try, it should be a fun challenge
  2. sx can be achieved by exporting 'styleSheet' and 'parseRules'
// 3-2
const Button = styled(
  'button',
  (theme) => ({
    width: '$width',
    padding: theme.spacing(1)
  }),
  {
    size: {
      small: {...},
      large: {...}
    },
    color: {
      primary: {...},
      secondary: {...},
      success: {...},
      error: {...},
      info: {...},
      warning: {...}
    }
  }
)

<Button variants={{ size: 'large', color: 'primary' }} vars={{ width }} />

from styils.

zoy-l avatar zoy-l commented on May 27, 2024

@oliviertassinari next13 server-component demo

server components, as if there is not much difference between server rendering, except that cannot use context, to use themes, need to implement it in a different way..

from styils.

oliviertassinari avatar oliviertassinari commented on May 27, 2024

if there is not much difference between server rendering, except that cannot use context, to use themes, need to implement it in a different way.

Interesting

from styils.

Related Issues (6)

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.