Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@opensea/react-media
Advanced tools
Javascript library to deal with media queries in isomorphic React applications.
@opensea/react-media
is a Javascript library to deal with media queries in isomorphic React applications.
Its heavily inspired by https://github.com/artsy/fresnel but is compatible with React 18.
npm
npm i @opensea/react-media
yarn
yarn add @opensea/react-media
// media.ts
import { createMedia } from '@opensea/react-media';
const { createMediaStyle, Media, SizeProvider } = createMedia({
sm: 640,
md: 768,
lg: 1024,
xl: 1280,
'2xl': 1536,
container: 1600,
'3xl': 1910
});
export const mediaStyle = createMediaStyle();
// ComponentX.react.tsx
export function ComponentX() {
return <Media greaterThan="md">Render if greater than md</Media>;
}
// __app.tsx
import React from 'react';
import { SizeProvider } from './media';
import type { AppProps } from 'next/app';
export default function App({ Component, pageProps }: AppProps) {
return (
<SizeProvider>
<Component {...pageProps} />
</SizeProvider>
);
}
// _document.tsx
import { Html, Head, Main, NextScript } from 'next/document';
import { mediaStyles } from './media';
export default function Document() {
return (
<Html>
<Head>
<style
dangerouslySetInnerHTML={{ __html: mediaStyles }}
type="text/css"
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
FAQs
Javascript library to deal with media queries in isomorphic React applications.
The npm package @opensea/react-media receives a total of 182 weekly downloads. As such, @opensea/react-media popularity was classified as not popular.
We found that @opensea/react-media demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.