Skip to content

Instantly share code, notes, and snippets.

@patientplatypus
Created July 23, 2017 20:44
Show Gist options
  • Save patientplatypus/c655c9db3c7557e125dad12c7dc42a61 to your computer and use it in GitHub Desktop.
Save patientplatypus/c655c9db3c7557e125dad12c7dc42a61 to your computer and use it in GitHub Desktop.
child css not overriding parents and i dont know why
const EmojiGlamor = glamorous.div(
{
position: 'absolute',
backgroundColor: 'red',
borderRadius: "20px",
marginTop: '-20px',
marginLeft: '10px',
marginRight: '10px'
},
({size})=>({
fontSize: size
}),
({shape})=>({
width: shape,
height: shape*1.2
}),
({offsetleft})=>({
left: offsetleft
}),
({offsettop})=>({
top: offsettop
}),
({font})=>({
fontSize: font
})
);
const EmojiScared = glamorous.div(
{
position: 'absolute',
},
({font})=>({
fontSize: font
})
)
<Motion style={{fontspring: spring(mobxStore.tornadoplaceholdervisible ? 50 : 0),
scaredfontspring: spring(mobxStore.tornadoplaceholdervisible ? 20:0)}}
onRest={()=>this.tornadoplaceholderfinished()}
>
{style =>
(
<div>
<EmojiGlamor
size={`${style.fontspring}px`}
offsetleft={`${100-0.5*style.fontspring}px`}
offsettop={`${100-0.5*style.fontspring}px`}
shape={`${style.fontspring}px`}
>
omg why would you do that?
<EmojiScared
size={`${style.scaredfontspring}px`}
>
&#x1F628;
</EmojiScared>
</EmojiGlamor>
</div>
)
}
</Motion>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment