我想使用Tailwind做类似这样的事情,
@/media screen and (max-width: 995px) , screen and (max-height: 700px) { ... }
这可行吗?
@/media screen and (max-width: 995px) , screen and (max-height: 700px) { ... }
这可行吗?
解决方案:
screens: {
'custombp': {'raw': '(max-height: 1234px),(min-width:920px)'}
}
代表问题提问者添加。
raw
根据高度和宽度创建细粒度的断点。这是一个链接,指向相关文档,我在阅读上述答案后才找到的。
module.exports = {
theme: {
screens: {
'sm': '640px',
// => @media (min-width: 640px) { ... }
'md': '768px',
// => @media (min-width: 768px) { ... }
'lg': '1024px',
// => @media (min-width: 1024px) { ... }
'xl': '1280px',
// => @media (min-width: 1280px) { ... }
}
}
}
and
,而且应该有and
,因为raw
意味着它只是盲目地将其粘贴到输出中,并在前面加上@media
... - Justin