kristerkari / react-native-sass-transformer

Use Sass to style your React Native apps.
MIT License
219 stars 19 forks source link

Platform-specific properties #38

Closed ADavidLiu closed 4 years ago

ADavidLiu commented 4 years ago

How would I go about applying platform-specific styles? For example, how could I convert this box-shadow:

const styles = StyleSheet.create({
    box: {
        shadowColor: "black",
        shadowOpacity: 1,
        shadowRadius: 10,
        shadowOffset: {
            height: 2,
            width: 2
        },
        elevation: 5
    },
});

Into something that would go inside a .scss file? It looks like simply adding a box-shadow equivalent doesn't work either.

kristerkari commented 4 years ago

Thanks, the box-shadow property does work. In your case this would be the CSS to use:

.box {
  box-shadow: 2px 2px 10px black;
  elevation: 5;
}
kristerkari commented 4 years ago

I'm guessing that this is resolved now, closing...