You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

gatsby-plugin-fresnel

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-fresnel

[![npm version](https://badge.fury.io/js/gatsby-plugin-fresnel.svg)](https://badge.fury.io/js/gatsby-plugin-fresnel)


Version published
Maintainers
1
Created

Readme

Source

gatsby-plugin-fresnel

npm version

Provides easy drop-in support for @artsy/fresnel in Gatsby.

Install

yarn add gatsby-plugin-fresnel

How to use

Add the plugin to your gatsby-config.js and configure (see fresnel's config API):

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-fresnel`,
      options: {
        breakpoints: {
          sm: 0,
          md: 768,
          lg: 1024,
          xl: 1192,
        },
      },
    },
  ],
};

This package exposes a pre-configured Media component for creating media queries:

import React from 'react';
import { Media } from 'gatsby-plugin-fresnel';

const Home = () => (
  <>
    <Media at="sm">
      <MobileApp />
    </Media>
    <Media at="md">
      <TabletApp />
    </Media>
    <Media greaterThanOrEqual="lg">
      <DesktopApp />
    </Media>
  </>
);

See the @artsy/fresnel README for full documentation.

⚠️ Render behavior

Note that this plugin utilizes the disableDynamicMediaQueries option from @artsy/fresnel to mitigate hydration mismatch errors introduced in React 18. As a result, all children of Media components will be rendered regardless of visibility.

For more information, refer to @artsy/fresnel's README section.

Keywords

FAQs

Package last updated on 12 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc