|
| 1 | +# Demo App Style Reference |
| 2 | + |
| 3 | +Design spec for OneSignal SDK demo/sample apps. Values use platform-independent units (px). Adapt to the equivalent on each platform (dp on Android, pt on iOS, px in CSS, etc.). |
| 4 | + |
| 5 | +## Colors |
| 6 | + |
| 7 | +| Token | Value | Usage | |
| 8 | +| ----------------- | ------------------- | ------------------------------ | |
| 9 | +| oneSignalRed | `#E54B4D` | Header, primary buttons | |
| 10 | +| oneSignalGreen | `#34A853` | Logged-in / success status | |
| 11 | +| lightBackground | `#F8F9FA` | Page background | |
| 12 | +| cardBackground | `#FFFFFF` | Card surfaces | |
| 13 | +| dividerColor | `#E8EAED` | Dividers | |
| 14 | +| warningBackground | `#FFF8E1` | Guidance / warning banner card | |
| 15 | +| overlayScrim | `rgba(0,0,0,0.26)` | Loading overlay background | |
| 16 | +| sectionHeaderText | `#616161` | Section header label and icon | |
| 17 | +| subtleText | `#757575` | Toggle descriptions, secondary text | |
| 18 | + |
| 19 | +## Spacing |
| 20 | + |
| 21 | +| Token | Value | Usage | |
| 22 | +| --------------------------- | ------------------------------ | ----------------------------------------------------------- | |
| 23 | +| gap | 8 | Gap between elements inside a section | |
| 24 | +| Section spacing | 24 vertical, 16 horizontal | Gap between sections. CSS platforms can use `gap: 24` on the list container instead of per-section padding | |
| 25 | + |
| 26 | +## Cards |
| 27 | + |
| 28 | +| Property | Value | |
| 29 | +| --------------- | -------------------------- | |
| 30 | +| Background | cardBackground (`#FFFFFF`) | |
| 31 | +| Corner radius | 12 | |
| 32 | +| Inner padding | 12 horizontal, 12 vertical | |
| 33 | +| Outer margin | 0 (parent section handles spacing) | |
| 34 | + |
| 35 | +### Card Shadow |
| 36 | + |
| 37 | +Use the platform's standard light shadow (elevation 1 on Android/Flutter, a subtle `box-shadow` in CSS). No header/toolbar shadow. Also applies to the warning/guidance banner. |
| 38 | + |
| 39 | +For CSS-based platforms, the equivalent shadow layers are: |
| 40 | + |
| 41 | +| Layer | Offset | Blur | Spread | Color | |
| 42 | +| -------- | ------- | ---- | ------ | ------------------ | |
| 43 | +| Umbra | 0, 2 | 1 | -1 | `rgba(0,0,0,0.20)` | |
| 44 | +| Penumbra | 0, 1 | 1 | 0 | `rgba(0,0,0,0.14)` | |
| 45 | +| Ambient | 0, 1 | 3 | 0 | `rgba(0,0,0,0.12)` | |
| 46 | + |
| 47 | +## Typography |
| 48 | + |
| 49 | +All sizes in sp/px. Use the platform's default system font unless otherwise noted. |
| 50 | + |
| 51 | +### Text Scale Reference |
| 52 | + |
| 53 | +| Name | Size | Weight | Usage | |
| 54 | +| ----------- | ---- | ---------- | -------------------------------------------- | |
| 55 | +| bodyLarge | 16 | normal/400 | Radio button labels (dialogs) | |
| 56 | +| bodyMedium | 14 | normal/400 | Card row labels, toggle labels, list items | |
| 57 | +| bodySmall | 12 | normal/400 | Card row values, toggle descriptions, section headers | |
| 58 | + |
| 59 | +### Header Bar |
| 60 | + |
| 61 | +- Logo height: 22 |
| 62 | +- Title text ("Sample App"): bodyMedium (14, normal/400), color white |
| 63 | +- Centered |
| 64 | + |
| 65 | +### Section Headers |
| 66 | + |
| 67 | +- Size: bodySmall (12) |
| 68 | +- Weight: bold |
| 69 | +- Color: sectionHeaderText |
| 70 | +- Letter spacing: 0.5 |
| 71 | +- Transform: uppercase |
| 72 | +- Bottom padding: 8 (gap) |
| 73 | +- Info icon: 18, color sectionHeaderText |
| 74 | + |
| 75 | +### Card Row Labels |
| 76 | + |
| 77 | +- Style: bodyMedium (14) (e.g., "App ID", "Push ID", "Status") |
| 78 | + |
| 79 | +### Card Row Values |
| 80 | + |
| 81 | +- Style: bodySmall (12) |
| 82 | +- Font: monospace |
| 83 | + |
| 84 | +### Toggle Row |
| 85 | + |
| 86 | +- Label: bodyMedium (14) |
| 87 | +- Description: bodySmall (12), color subtleText |
| 88 | + |
| 89 | +### Radio Button Labels (Dialogs) |
| 90 | + |
| 91 | +- Style: bodyLarge (16) |
| 92 | + |
| 93 | +## Buttons |
| 94 | + |
| 95 | +### Primary Button |
| 96 | + |
| 97 | +- Full width |
| 98 | +- Background: oneSignalRed |
| 99 | +- Text color: white |
| 100 | +- Height: 48 |
| 101 | +- Corner radius: 8 |
| 102 | + |
| 103 | +### Destructive / Outlined Button |
| 104 | + |
| 105 | +- Full width |
| 106 | +- Background: transparent |
| 107 | +- Border + text color: oneSignalRed |
| 108 | +- Height: 48 |
| 109 | +- Corner radius: 8 |
| 110 | + |
| 111 | +## Toggle / Switch |
| 112 | + |
| 113 | +- Use the platform's native switch component |
| 114 | +- Reduce extra tap-target padding where the platform allows |
| 115 | + |
| 116 | +## Dialogs |
| 117 | + |
| 118 | +- Horizontal inset from screen edge: 16 |
| 119 | +- Vertical inset: 24 |
| 120 | + |
| 121 | +## Dividers |
| 122 | + |
| 123 | +- Use the platform's default divider / separator (1px line, subtle grey) |
| 124 | + |
| 125 | +## Text Input Fields |
| 126 | + |
| 127 | +- Corner radius: 8 |
| 128 | +- Content padding: 12 horizontal, 14 vertical |
| 129 | + |
| 130 | +## Warning Banner |
| 131 | + |
| 132 | +- Uses card styling (shadow, corner radius) with warningBackground color |
| 133 | +- Text: bodySmall (12) |
| 134 | +- Link: bodySmall (12), color oneSignalRed, weight semibold/600, no underline, no gap above |
| 135 | + |
| 136 | +## Scrollable List |
| 137 | + |
| 138 | +- Bottom padding: 24 |
| 139 | + |
| 140 | +## Loading Overlay |
| 141 | + |
| 142 | +- Full-screen scrim over content |
| 143 | +- Background: overlayScrim (`rgba(0,0,0,0.26)`) |
| 144 | +- Centered spinner using the platform's native progress indicator |
0 commit comments