How to use the @artsy/palette.themeProps.mediaQueries function in @artsy/palette

To help you get started, we’ve selected a few @artsy/palette examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github artsy / fresnel / src / index.tsx View on Github external
const MediaContextProvider: React.SFC> = ({
    onlyRenderAt,
    children,
  }) => {
    const { hover, ...breakpointMediaQueries } = themeProps.mediaQueries
    return (
      
        
          {matches => {
            const matchingBreakpoints = Object.keys(matches).filter(
              key => matches[key]
            )

            // FIXME: Remove
            // console.log(matchingBreakpoints)
            return (
github artsy / reaction / src / Artsy / Router / Boot.tsx View on Github external
render() {
    const { children, context, headTags = [], ...props } = this.props
    const contextProps = {
      ...props,
      ...context,
    }

    return (
      
        
          
            
              
                
                  
                    
                      
                      {children}
                      {process.env.NODE_ENV === "development" && (
                        
                      )}
github artsy / reaction / src / Utils / Hooks / useMedia.ts View on Github external
export function useMedia(): { [k in Breakpoint]?: boolean } {
  const matches = Object.entries(themeProps.mediaQueries).reduce(
    (acc, [key, value]) => {
      return {
        ...acc,
        [key]: useMatchMedia(value),
      }
    },
    {}
  )
  return matches
}
github artsy / reaction / src / Styleguide / Elements / Button.tsx View on Github external
${props => {
              const { colors } = props.theme
              return `
                background-color: ${colors.white100};
                border-color: ${colors.black10};
                color: ${colors.black100};

                @media ${themeProps.mediaQueries.hover} {
                  &:hover {
                    background-color: ${colors.white100};
                    border-color: ${colors.black100};
                    color: ${colors.black100};
                  }
                }
              `
            }};
          `