📜  带有媒体查询的条件样式组件 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:31.443000             🧑  作者: Mango

代码示例1
import styled, { css } from 'styled-components'

const YourComponent = styled.div`
  //...
  
  ${props => props.isFirstPage && css`
     @media only screen and (max-width: 480px) {
       padding: 8px 8px 24px 8px
     }
  `}
`;