Giter Club home page Giter Club logo

Comments (6)

liamqma avatar liamqma commented on June 1, 2024

@JakeLane @dddlr @itsdouges @zerosicx

from compiled.

liamqma avatar liamqma commented on June 1, 2024

I realised that this approach only works if stylesheet extraction is enabled, as it needs to sort the entire sheet at once.
When stylesheet extraction is disabled, Compiled individually collects the sheets (from Components), and put them in the <Head>. Note this is done on client-side.

from compiled.

itsdouges avatar itsdouges commented on June 1, 2024

Mm I think style groups are still ordered when ran in runtime mode. Let me look.

Edit: https://github.com/atlassian-labs/compiled/blob/master/packages/react/src/runtime/sheet.ts

from compiled.

liamqma avatar liamqma commented on June 1, 2024

Mm I think style groups are still ordered when ran in runtime mode. Let me look.

Yea, but I think ordering the breakpoints on client-side is going to be quite a runtime cost.

from compiled.

itsdouges avatar itsdouges commented on June 1, 2024

True.

from compiled.

liamqma avatar liamqma commented on June 1, 2024

I can think of two options:

Option 1: Ask the users of Compiled to avoid overlapping breaking points

const style = css({
   "@media (min-width: 10px and max-width: 19px)": {
      color: "red"
   },
   "@media (min-width: 20px)": {
      color: "green"
   }
})

Option 2: Sort the media query by break points somehow.

I will take a look how Stylex does it.

from compiled.

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.