mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 03:32:51 +02:00
fix: theme transition error on ios
This commit is contained in:
parent
45385fd84a
commit
93eca1fa7a
6 changed files with 23 additions and 20 deletions
|
@ -17,6 +17,7 @@ const marginBottom = {
|
||||||
<header>
|
<header>
|
||||||
<h1 class={`${marginBottom} mt--5 text-12.8 c-primary font-bold font-title`}>
|
<h1 class={`${marginBottom} mt--5 text-12.8 c-primary font-bold font-title`}>
|
||||||
<a
|
<a
|
||||||
|
class="ios-flash-fix"
|
||||||
href={getLocalizedPath('/')}
|
href={getLocalizedPath('/')}
|
||||||
transition:name="site-title"
|
transition:name="site-title"
|
||||||
data-disable-transition-on-theme
|
data-disable-transition-on-theme
|
||||||
|
|
|
@ -19,8 +19,8 @@ const isAboutActive = isAbout;
|
||||||
href={getLocalizedPath('/')}
|
href={getLocalizedPath('/')}
|
||||||
class:list={[
|
class:list={[
|
||||||
isPostActive
|
isPostActive
|
||||||
? 'font-bold text-primary'
|
? 'font-bold c-primary'
|
||||||
: 'hover:text-primary hover:font-bold',
|
: 'hover:c-primary hover:font-bold',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{currentUI.posts}
|
{currentUI.posts}
|
||||||
|
@ -31,8 +31,8 @@ const isAboutActive = isAbout;
|
||||||
href={getLocalizedPath('/tags')}
|
href={getLocalizedPath('/tags')}
|
||||||
class:list={[
|
class:list={[
|
||||||
isTagActive
|
isTagActive
|
||||||
? 'font-bold text-primary'
|
? 'font-bold c-primary'
|
||||||
: 'hover:text-primary hover:font-bold',
|
: 'hover:c-primary hover:font-bold',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{currentUI.tags}
|
{currentUI.tags}
|
||||||
|
@ -43,8 +43,8 @@ const isAboutActive = isAbout;
|
||||||
href={getLocalizedPath('/about')}
|
href={getLocalizedPath('/about')}
|
||||||
class:list={[
|
class:list={[
|
||||||
isAboutActive
|
isAboutActive
|
||||||
? 'font-bold text-primary'
|
? 'font-bold c-primary'
|
||||||
: 'hover:text-primary hover:font-bold',
|
: 'hover:c-primary hover:font-bold',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{currentUI.about}
|
{currentUI.about}
|
||||||
|
|
|
@ -8,7 +8,7 @@ const { getLocalizedPath } = getPagePath(currentPath)
|
||||||
---
|
---
|
||||||
|
|
||||||
<a
|
<a
|
||||||
class="mt--1.4 text-8.32 c-secondary font-bold font-title"
|
class="ios-flash-fix mt--1.4 text-8.32 c-secondary font-bold font-title"
|
||||||
href={getLocalizedPath('/')}
|
href={getLocalizedPath('/')}
|
||||||
transition:name="site-title"
|
transition:name="site-title"
|
||||||
data-disable-transition-on-theme
|
data-disable-transition-on-theme
|
||||||
|
|
|
@ -37,7 +37,7 @@ const postsByYear = await getPostsByYear()
|
||||||
// Single Post
|
// Single Post
|
||||||
<li class="mt-7">
|
<li class="mt-7">
|
||||||
{/* Post Title */}
|
{/* Post Title */}
|
||||||
<a class="hover:text-primary" href={`/posts/${post.data.slug || post.slug}`}>{post.data.title}</a>
|
<a class="hover:c-primary" href={`/posts/${post.data.slug || post.slug}`}>{post.data.title}</a>
|
||||||
{/* Post Date */}
|
{/* Post Date */}
|
||||||
<div class="mb-9 block text-5.6 leading-11 font-time lg:ml-4 lg:inline">
|
<div class="mb-9 block text-5.6 leading-11 font-time lg:ml-4 lg:inline">
|
||||||
{post.data.published.toLocaleDateString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '-')}
|
{post.data.published.toLocaleDateString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '-')}
|
||||||
|
|
|
@ -5,9 +5,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
--at-apply: 'bg-background c-secondary text-62.5% antialiased scroll-smooth';
|
--at-apply: 'bg-background c-secondary text-62.5% antialiased scroll-smooth scrollbar-hidden';
|
||||||
scrollbar-width: none;
|
|
||||||
-ms-overflow-style: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html::-webkit-scrollbar {
|
html::-webkit-scrollbar {
|
||||||
|
@ -15,10 +13,7 @@ html::-webkit-scrollbar {
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
--at-apply: 'text-1.6rem';
|
--at-apply: 'text-1.6rem ios-flash-fix';
|
||||||
/* Fix for iOS browser flash issue */
|
|
||||||
backface-visibility: hidden;
|
|
||||||
-webkit-backface-visibility: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
|
@ -46,10 +41,8 @@ h6 {
|
||||||
}
|
}
|
||||||
|
|
||||||
article img {
|
article img {
|
||||||
--at-apply: 'cursor-zoom-in';
|
|
||||||
/* Optimize animation performance of Scrollbar */
|
/* Optimize animation performance of Scrollbar */
|
||||||
transform: translateZ(0);
|
--at-apply: 'cursor-zoom-in ios-flash-fix';
|
||||||
-webkit-transform: translateZ(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Horizontal reveal animation on theme toggle */
|
/* Horizontal reveal animation on theme toggle */
|
||||||
|
@ -84,7 +77,7 @@ html[data-theme-transition] [data-disable-transition-on-theme] {
|
||||||
|
|
||||||
@supports not (view-transition-name: none) {
|
@supports not (view-transition-name: none) {
|
||||||
html:not([data-restore-theme]) {
|
html:not([data-restore-theme]) {
|
||||||
--at-apply: 'transition-colors duration-500 ease-in-out';
|
--at-apply: 'transition-colors duration-300 ease-in-out';
|
||||||
}
|
}
|
||||||
|
|
||||||
html:not([data-restore-theme]) [data-disable-transition-on-theme] {
|
html:not([data-restore-theme]) [data-disable-transition-on-theme] {
|
||||||
|
|
|
@ -35,7 +35,16 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
shortcuts: {},
|
shortcuts: {},
|
||||||
rules: [],
|
rules: [
|
||||||
|
['scrollbar-hidden', {
|
||||||
|
'scrollbar-width': 'none',
|
||||||
|
'-ms-overflow-style': 'none',
|
||||||
|
}],
|
||||||
|
['ios-flash-fix', {
|
||||||
|
'backface-visibility': 'hidden',
|
||||||
|
'-webkit-backface-visibility': 'hidden',
|
||||||
|
}],
|
||||||
|
],
|
||||||
transformers: [
|
transformers: [
|
||||||
transformerDirectives(),
|
transformerDirectives(),
|
||||||
transformerVariantGroup(),
|
transformerVariantGroup(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue