Coder Social home page Coder Social logo

Comments (3)

b6pzeusbc54tvhw5jgpyw8pwz2x6gs avatar b6pzeusbc54tvhw5jgpyw8pwz2x6gs commented on May 21, 2024

I also want to use &.
(& represents the current selector parent sush a less or stylus )

css-in-js:

const st = cssInJS({
  box: {
    color: 'red',
    width: 100,
    height: 40,
    '&:hover': {
      color: 'blue',
      '.hiddenBtn': {
        opacity: 1
      },
      '& > .normalBtn': {
        marginRight: 10
      }
    }
  }
})

babel:

const st = {
  box: 'dir_filename_js-styles-box',
  hiddenBtn: 'dir_filename_js-styles-hiddenBtn',
  normalBtn: 'dir_filename_js-styles-normalBtn'
}

css:

.dir_filename_js-styles-box {
  color: red;
  width: 100px;
  height: 40px;
}
.dir_filename_js-styles-box:hover {
  color: blue;
}
.dir_filename_js-styles-box:hover .dir_filename_js-styles-hiddenBtn {
  opacity: 1;
}
.dir_filename_js-styles-box:hover > .dir_filename_js-styles-normalBtn {
  marginRight: 10px;
}

from babel-plugin-css-in-js.

martinandert avatar martinandert commented on May 21, 2024

Hi Alfred, sorry for the delay.

Could I make some PR?

Sure! Happy to merge any of the improvements you're talking about. Thanks!

from babel-plugin-css-in-js.

b6pzeusbc54tvhw5jgpyw8pwz2x6gs avatar b6pzeusbc54tvhw5jgpyw8pwz2x6gs commented on May 21, 2024

I'll try it if I have some time.
Please let me know if anyone has any idea or feedback on this issue.

from babel-plugin-css-in-js.

Related Issues (18)

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.