Skip to content
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

add support info #4

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions example/app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export default function RootLayout({ children }) {
Source Code ↗
</a>
</p>
<p className="support">
<span className="no">️🔴 You do not have support for view transitions.</span>
<span className="yes">️🟢 You have support for view transitions.</span>
</p>
<p></p>
<div>{children}</div>
<footer>
Expand Down
32 changes: 29 additions & 3 deletions example/app/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*::after {
box-sizing: border-box;
}

* {
margin: 0;
}
Expand Down Expand Up @@ -42,9 +43,9 @@ h6 {
/** Styles */
body {
font-family: var(--font-geist-sans), system-ui, -apple-system,
BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans,
sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol,
Noto Color Emoji;
BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans,
sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol,
Noto Color Emoji;
font-feature-settings: 'liga', 'clig', 'calt';
font-variant: common-ligatures contextual;
letter-spacing: -0.01em;
Expand Down Expand Up @@ -131,3 +132,28 @@ footer {
.demo-box h2:first-child {
margin-top: 0;
}

.support span {
padding: 4px 6px;
border-radius: 8px;
}

.support .no {
color: rgba(200, 0, 0, 1);
background-color: rgba(200, 0, 0, 0.1);
}

.support .yes {
display: none;
color: rgb(0, 120, 0);
background-color: rgba(0, 120, 0, 0.1);
}

@supports (view-transition-name: figure-caption) {
.support .yes {
display: inline;
}
.support .no {
display: none;
}
}