Skip to content

What is the equivalent of mixin? #258

Answered by daryawood
HeartSquared asked this question in Q&A
Discussion options

You must be logged in to vote

I'd suggest using functions :)

const HIGHLIGHT_OVERFLOW = '';

const highlight = (bgColor) => {
  return {
      backgroundColor: bgColor,
      top: '50%',
      bottom: `calc(${HIGHLIGHT_OVERFLOW} * -1)`,
  }
}

const navItem = style({
  selectors: {
    '&:hover::after': {
      ...highlight(tokens.colour.bulbasaur),
     // other rules
    },
  },
});

Replies: 1 comment 1 reply

Comment options

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

Answer selected by HeartSquared
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