[英]Aphrodite CSS overwriting margin and padding
I'm having an issue with aphrodite, where if I have my base-component set to the global selector for example margin: 0
or any of the sides marginLeft
, marginRight
, marginTop
, marginBottom
set. 我对阿芙罗狄蒂有问题,如果我将基本组件设置为全局选择器,例如margin: 0
或设置了marginLeft
, marginRight
, marginTop
, marginBottom
任何一个。 Then when I try to overwrite one or the other, it doesn't take. 然后,当我尝试覆盖一个或另一个时,就没有了。
For instance a div
set with margin: 0
then I add another style marginBottom: 10
doesn't work. 例如, div
设置margin: 0
然后添加另一个样式marginBottom: 10
不起作用。 Same is true in reverse. 反之亦然。 If marginBottom: 10
is set and I set margin: 0
it doesn't work. 如果设置marginBottom: 10
,而我设置margin: 0
,则不起作用。
https://github.com/Khan/aphrodite https://github.com/Khan/aphrodite
From the docs: Object Key Ordering 从文档: 对象键排序
const styles = StyleSheet.create({
ordered: new Map([
["margin", 0],
["marginLeft", 15],
]),
});
Note that Maps are not fully supported in all browsers. 请注意,并非所有浏览器都完全支持地图。 It can be polyfilled by using a package like es6-shim . 可以使用es6-shim这样的软件包对它进行填充 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.