Skip to content

Reference element from another element #281

Answered by Tao-VanJS
HEAVYPOLY asked this question in Q&A
Discussion options

You must be logged in to vote

One of the pattern you can following is something like:

const PricingCard = (v) => {
  const listDom = ul({ style: 'margin-bottom:auto;box-sizing:border-box;' },
    v.includes.map(i => li({ style: 'font-size:1.7rem' }, i)),
  )

  return div({
    class: `pricingCard ${v.class}`,
    style: `height:57rem;font-size:3rem;border:solid .5rem ${v.color}`,
    onmouseover: (e) => {
      e.target.style.boxShadow = `0 0 3rem ${v.color}`; e.target.style.borderColor = adjustCSSBrightness(v.color, 1.1)
      checkoutButtonRef.style.background = adjustCSSBrightness(v.color, 1.1)
    },
    onmouseout: (e) => { e.target.style.boxShadow = 'var(--shadow)'; e.target.style.borderColor = v.color },
  },
  

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Tao-VanJS
Comment options

You must be logged in to vote
0 replies
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