Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Responsive style sheet #6

Open
italomlp opened this issue Jun 29, 2021 · 4 comments
Open

[Feature request] Responsive style sheet #6

italomlp opened this issue Jun 29, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@italomlp
Copy link

italomlp commented Jun 29, 2021

Hello guys! First of all, awesome lib @diego3g. I think it will be very helpful for us all!

One thing that can be a great addon is a ResponsiveStyleSheet (or ResponsiveSheet, if you prefer) that acts like the default rn's Stylesheet plus a parser to rem flags. It's something like the ScaledSheet from react-native-size-matters. It could be nice for the ones that often use the default Stylesheet instead of styled-components. So, for example, we can have something like:

import { ResponsiveStyleSheet } from 'react-native-size-matters';

const styles = ResponsiveStyleSheet.create({
  container: {
    width: '100rem',
    height: '200rem',
    padding: '2rem',
    margin: 5
  },
  row: {
    padding: '10rem',
    width: '50rem',
    height: '30rem'
  }
});

What do you think about it?

@diego3g
Copy link
Owner

diego3g commented Jun 29, 2021

That would be great, but i think we should not replace StyleSheet from React Native but maybe we should make it work as a extension like:

import { StyleSheet } from 'react-native';
import { makeResponsive } from 'responsive-native';

const styles = makeResponsive(
  StyleSheet.create({
    container: {
      width: '100rem',
      height: '200rem',
      padding: '2rem',
      margin: 5
    },
    row: {
      padding: '10rem',
      width: '50rem',
      height: '30rem'
    }
  })
);

I don't know the better API for that for now, but I'll think a little bit more about it.

@diego3g diego3g added the enhancement New feature or request label Jun 29, 2021
@italomlp
Copy link
Author

@diego3g nice man! Makes sense. Let me know if I can support you with ideas or the implementation part. I would be happy to help.

@diego3g
Copy link
Owner

diego3g commented Jun 30, 2021

I'm working on this (dd80a35)

@juniorogaa
Copy link

Hey guys, all right? How is the implementation of this feature going? It would be very important for the project I'm working on. Help us @diego3g <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants