1.2.0 ā€¢ Published 4 years ago

system-media v1.2.0

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

Welcome to system-media šŸ‘‹

npm version License: MIT

A React utility library to match your props to the given media query

šŸ  Homepage

Install

npm install system-media

Usage

Codesandbox Link:

https://codesandbox.io/s/crazy-zhukovsky-u18zw

import React from 'react';

import { system } from 'system-media';

const theme = {
  // Default breakpoints used by styled-system
  breakpoints: ['40em', '52em', '64em'],
};

const Text = ({ value }) => (
  <p
    style={{
      fontFamily: 'comic-sans',
      fontSize: '16px',
    }}
  >
    {system(theme.breakpoints)(value)}
  </p>
);

export default function App() {
  const user = 'Dan Abramov';
  const userDisplayNameMobile = user.split(' ')[0];
  const userDisplayNameDesktop = user;
  return (
    <div className="App">
      <Text
        value={[`Hi ${userDisplayNameMobile}`, `Hi ${userDisplayNameDesktop}`]}
      />
    </div>
  );
}

Author

šŸ‘¤ JM Santos johmichaelubas.santos@gmail.com

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ā­ļø if this project helped you!

1.2.0

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago