-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(datetime): add playground for styling wheel pickers #2982
Merged
+184
−6
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
static/usage/v7/datetime/styling/wheel-styling/angular/example_component_css.md
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,16 @@ | ||
```css | ||
ion-datetime { | ||
--background: rgb(245, 235, 247); | ||
--background-rgb: 245, 235, 247; | ||
--wheel-highlight-background: rgb(218, 216, 255); | ||
--wheel-fade-background-rgb: 245, 235, 247; | ||
} | ||
|
||
ion-datetime::part(wheel-item) { | ||
color: rgb(255, 66, 97); | ||
} | ||
|
||
ion-datetime::part(wheel-item active) { | ||
color: rgb(128, 30, 171); | ||
} | ||
``` |
3 changes: 3 additions & 0 deletions
3
static/usage/v7/datetime/styling/wheel-styling/angular/example_component_html.md
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,3 @@ | ||
```html | ||
<ion-datetime presentation="date" [preferWheel]="true"></ion-datetime> | ||
``` |
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Datetime</title> | ||
<link rel="stylesheet" href="../../../../common.css" /> | ||
<script src="../../../../common.js"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@7/dist/ionic/ionic.esm.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@7/css/ionic.bundle.css" /> | ||
|
||
<style> | ||
ion-datetime { | ||
--background: rgb(245, 235, 247); | ||
--background-rgb: 245, 235, 247; | ||
--wheel-highlight-background: rgb(218, 216, 255); | ||
--wheel-fade-background-rgb: 245, 235, 247; | ||
} | ||
|
||
ion-datetime::part(wheel-item) { | ||
color: rgb(255, 66, 97); | ||
} | ||
|
||
ion-datetime::part(wheel-item active) { | ||
color: rgb(128, 30, 171); | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<ion-app> | ||
<ion-content> | ||
<div class="container"> | ||
<ion-datetime presentation="date" prefer-wheel="true"></ion-datetime> | ||
</div> | ||
</ion-content> | ||
</ion-app> | ||
</body> | ||
</html> |
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,33 @@ | ||
import Playground from '@site/src/components/global/Playground'; | ||
|
||
import javascript from './javascript.md'; | ||
|
||
import react_main_tsx from './react/main_tsx.md'; | ||
import react_main_css from './react/main_css.md'; | ||
|
||
import vue from './vue.md'; | ||
|
||
import angular_example_component_html from './angular/example_component_html.md'; | ||
import angular_example_component_css from './angular/example_component_css.md'; | ||
|
||
<Playground | ||
version="7" | ||
code={{ | ||
javascript, | ||
react: { | ||
files: { | ||
'src/main.tsx': react_main_tsx, | ||
'src/main.css': react_main_css, | ||
}, | ||
}, | ||
vue, | ||
angular: { | ||
files: { | ||
'src/app/example.component.html': angular_example_component_html, | ||
'src/app/example.component.css': angular_example_component_css, | ||
}, | ||
}, | ||
}} | ||
src="usage/v7/datetime/styling/wheel-styling/demo.html" | ||
size="250px" | ||
/> |
20 changes: 20 additions & 0 deletions
20
static/usage/v7/datetime/styling/wheel-styling/javascript.md
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,20 @@ | ||
```html | ||
<style> | ||
ion-datetime { | ||
--background: rgb(245, 235, 247); | ||
--background-rgb: 245, 235, 247; | ||
--wheel-highlight-background: rgb(218, 216, 255); | ||
--wheel-fade-background-rgb: 245, 235, 247; | ||
} | ||
|
||
ion-datetime::part(wheel-item) { | ||
color: rgb(255, 66, 97); | ||
} | ||
|
||
ion-datetime::part(wheel-item active) { | ||
color: rgb(128, 30, 171); | ||
} | ||
</style> | ||
|
||
<ion-datetime presentation="date" prefer-wheel="true"></ion-datetime> | ||
``` |
16 changes: 16 additions & 0 deletions
16
static/usage/v7/datetime/styling/wheel-styling/react/main_css.md
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,16 @@ | ||
```css | ||
ion-datetime { | ||
--background: rgb(245, 235, 247); | ||
--background-rgb: 245, 235, 247; | ||
--wheel-highlight-background: rgb(218, 216, 255); | ||
--wheel-fade-background-rgb: 245, 235, 247; | ||
} | ||
|
||
ion-datetime::part(wheel-item) { | ||
color: rgb(255, 66, 97); | ||
} | ||
|
||
ion-datetime::part(wheel-item active) { | ||
color: rgb(128, 30, 171); | ||
} | ||
``` |
11 changes: 11 additions & 0 deletions
11
static/usage/v7/datetime/styling/wheel-styling/react/main_tsx.md
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,11 @@ | ||
```tsx | ||
import React from 'react'; | ||
import { IonDatetime } from '@ionic/react'; | ||
|
||
import './main.css'; | ||
|
||
function Example() { | ||
return <IonDatetime presentation="date" preferWheel={true}></IonDatetime>; | ||
} | ||
export default Example; | ||
``` |
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,31 @@ | ||
```html | ||
<template> | ||
<ion-datetime presentation="date" :prefer-wheel="true"></ion-datetime> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { IonDatetime } from '@ionic/vue'; | ||
import { defineComponent } from 'vue'; | ||
|
||
export default defineComponent({ | ||
components: { IonDatetime }, | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
ion-datetime { | ||
--background: rgb(245, 235, 247); | ||
--background-rgb: 245, 235, 247; | ||
--wheel-highlight-background: rgb(218, 216, 255); | ||
--wheel-fade-background-rgb: 245, 235, 247; | ||
} | ||
|
||
ion-datetime::part(wheel-item) { | ||
color: rgb(255, 66, 97); | ||
} | ||
|
||
ion-datetime::part(wheel-item active) { | ||
color: rgb(128, 30, 171); | ||
} | ||
</style> | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not related to this PR, but this style doesn't seem to be impacting the active wheel item in the angular stackblitz (with
7.0.7-dev.11685554390.10c2ca9b
). Is that a known issue? It's working with the other frameworks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the Angular Stackblitzes are weird. There's a known Stackblitz bug we've been trying to resolve with them for a while where the Angular setup doesn't actually install the version you specify. AFAIK you have to download the repo (or just copy-paste the code) and install the dev build locally instead.