Skip to content

Follow up UI Libs that use state #490

Closed Answered by nmn
BMCwebdev asked this question in Q&A
Mar 11, 2024 · 5 comments · 10 replies
Discussion options

You must be logged in to vote

Still reading all your later comments, but you were using media queries wrong. ALL conditions for applying styles should be nested within the property value.

Here's the fixed code: https://stackblitz.com/edit/stylex-next-mucdgf?file=app%2Fpage.tsx

This is the code you need:

const buttonStyle = stylex.create({
  base: {
    padding: '1em',
    borderRadius: '12px',
    backgroundColor: {
      default: 'yellow',
      ':hover': 'darkred',
      [LIGHT]: {
        default: null,
        ':hover': 'red',
      },
    },
  },
});
const working = stylex.create({
  base: {
    backgroundColor: {
      default: 'green',
      [LIGHT]: 'lightgreen',
    },
  },
});

Another important thing that ma…

Replies: 5 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@nmn
Comment options

nmn Mar 12, 2024
Collaborator

@BMCwebdev
Comment options

@BMCwebdev
Comment options

Comment options

You must be logged in to vote
1 reply
@nmn
Comment options

nmn Mar 16, 2024
Collaborator

Comment options

You must be logged in to vote
2 replies
@BMCwebdev
Comment options

@nmn
Comment options

nmn Mar 16, 2024
Collaborator

Comment options

You must be logged in to vote
4 replies
@BMCwebdev
Comment options

@BMCwebdev
Comment options

@BMCwebdev
Comment options

@BMCwebdev
Comment options

Answer selected by BMCwebdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants