Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ActionSheet] Update docs to include themers (#5209)
### Context The docs for ActionSheet haven't been updated since the initial PR. ### The problem There was no section for theming, color or typography theming. ### The fix Add sections for both color and typography theming to the README.
- Loading branch information
Showing
4 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
### Color Theming | ||
|
||
You can theme an Action Sheet with your app's color scheme using the ColorThemer extension. | ||
|
||
You must first add the Color Themer extension to your project: | ||
|
||
```bash | ||
pod `MaterialComponentsAlpha/ActionSheet+ColorThemer` | ||
``` | ||
|
||
<!--<div class="material-code-render" markdown="1">--> | ||
#### Swift | ||
```swift | ||
// Step 1: Import the ColorThemer extension | ||
import MaterialComponentsAlpha.MaterialActionSheet_ColorThemer | ||
|
||
// Step 2: Create or get a color scheme | ||
let colorScheme = MDCSemanticColorScheme() | ||
|
||
// Step 3: Apply the color scheme to your component | ||
let actionSheet = MDCActionSheetController() | ||
MDCActionSheetColorThemer.applySemanticColorScheme(colorScheme, to: actionSheet) | ||
``` | ||
|
||
#### Objective-C | ||
|
||
```objc | ||
// Step 1: Import the ColorThemer extension | ||
#import "MaterialActionSheet+ColorThemer.h" | ||
|
||
// Step 2: Create or get a color scheme | ||
id<MDCColorScheming> colorScheme = [[MDCSematnicColorScheme alloc] init]; | ||
|
||
// Step 3: Apply the color scheme to your component | ||
MDCActionSheetController *actionSheet = [[MDCActionSheetController alloc] init]; | ||
[MDCActionSheetColorThemer applySemanticColorScheme:self.colorScheme | ||
toActionSheetController:actionSheet]; | ||
``` | ||
<!--</div>--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
### Typography Theming | ||
|
||
You can theme an Action Sheet with your app's typography scheme using the TypographyThemer extension. | ||
|
||
You must first add the Typography Themer extension to your project: | ||
|
||
```bash | ||
pod `MaterialComponentsAlpha/ActionSheet+TypographyThemer` | ||
``` | ||
|
||
<!--<div class="material-code-render" markdown="1">--> | ||
#### Swift | ||
```swift | ||
// Step 1: Import the ColorThemer extension | ||
import MaterialComponentsAlpha.MaterialActionSheet_TypographyThemer | ||
|
||
// Step 2: Create or get a color scheme | ||
let typographyScheme = MDCTypographyScheme() | ||
|
||
// Step 3: Apply the color scheme to your component | ||
let actionSheet = MDCActionSheetController() | ||
MDCActionSheetTypographyThemer.applyTypographyScheme(typographyScheme, to: actionSheet) | ||
``` | ||
|
||
#### Objective-C | ||
|
||
```objc | ||
// Step 1: Import the ColorThemer extension | ||
#import "MaterialActionSheet+TypographyThemer.h" | ||
|
||
// Step 2: Create or get a color scheme | ||
id<MDCTypographyScheming> typographyScheme = [[MDCTypographyScheme alloc] init]; | ||
|
||
// Step 3: Apply the color scheme to your component | ||
MDCActionSheetController *actionSheet = [[MDCActionSheetController alloc] init]; | ||
[MDCActionSheetTypographyThemer applyTypographyScheme:self.typographyScheme | ||
toActionSheetController:actionSheet]; | ||
``` | ||
<!--</div>--> |