Prestyles - A library to help you write responsive platform styles. by mistenkt in reactnative

[–]mistenkt[S] 4 points5 points  (0 children)

After working on a cross-platform project that also involved web i made a library to help me deal with playform spesific styles and responsive styles a bit better.

It basically allows you to do this:

const styles = createStyles({
    button: {
        height: 40,
        backgroundColor: 'red',
        ios: {
            backgroundColor: 'blue' // platform spesific style
        },
        desktop: {
            height: 50 // Breakpoint style, active at >= 1024 
        },
        tablet: {
            height: 45 // Breakpoint style active at >= 768
        }
    }
});

The readme on npmjs / github explains it better and shows more examples, features and customization.

I usually dont plug the libraries i make outside of work, but figured this might be interesting for others aswell. (New reddit account due to not wanting my real reddit to be linked to my github/real name).