Skip to content

Commit b9acef2

Browse files
authored
Merge pull request NativeScript#1904 from Burgov/patch-2
platform specific classes are now available without a plugin
2 parents d910760 + ebb9620 commit b9acef2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/ui/styling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ There are 4 primary ways to target styles at iOS or Android:
198198
1. Platform-specific stylesheets {% nativescript %}(`styles.ios.css`, `styles.android.css`){% endnativescript %}{% angular %}(`styles.component.ios.css`, `styles.component.android.css`){% endangular %}
199199
2. Platform-specific markup blocks (`<ios> ... </ios>`, `<android> ... </android>`)
200200
3. Platform-specific attributes (`<Label ios:style="..." android:style="..."`)
201-
4. Platform-specific CSS rules (`.ios .mystyle { ... }`, `.android .mystyle { ... }`) _[*requires plugin](https://market.nativescript.org/plugins/nativescript-platform-css)_
201+
4. Platform-specific CSS rules {% nativescript %}(`.ns-ios .mystyle { ... }`, `.ns-android .mystyle { ... }`){% endnativescript %}{% angular %}(`:host-content(.ns-ios) .mystyle { ... }`, `:host-context(.ns-android) .mystyle { ... }`){% endangular %}
202202
203203
The most common and maintainable pattern for managing platform-agnostic and platform-specific styles in NativeScript is with multiple stylesheets and CSS imports. Use {% nativescript %}[this Playground demo](https://play.nativescript.org/?template=play-tsc&id=JY218G){% endnativescript %}{% angular %}[this Playground demo](https://play.nativescript.org/?template=play-ng&id=Z4d8A6){% endangular %} to see this pattern in action.
204204

0 commit comments

Comments
 (0)