ulivz / vt

🖼️ A "Post-VuePress Era" Documentation Theme (Deprecation Warning: For a next-gen SSG, please check out Rspress.)
https://vt.insx.dev
MIT License
136 stars 10 forks source link

fix(theme): header remove 'position: relative' #40

Closed skychx closed 2 years ago

skychx commented 2 years ago

Description of the problem:

When using position: relative in the header, the link in the previous line is blocked and cannot be clicked.

Demo

use position: relative

<a href="www.baidu.com">baidu</a>
<h2 className='h2' >header use relative</h2>
.h2 {
    color: #213547;
    box-sizing: border-box;
    position: relative; /* <- this line */
    margin: 3rem 0 1.25rem;
}

.h2:hover {
  background-color: red;
}

h2::before {
  display: block;
  content: ' ';
  height: 70px;
  margin-top: -70px;
}

use

not use position: relative

<a href="www.baidu.com">baidu</a>
<h2 className='h2' >header not use relative</h2>
.h2 {
    color: #213547;
    box-sizing: border-box;
    /* position: relative;   <- this line */
    margin: 3rem 0 1.25rem;
}

.h2:hover {
  background-color: red;
}

h2::before {
  display: block;
  content: ' ';
  height: 70px;
  margin-top: -70px;
}

not

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

vuepress-docs – ./

🔍 Inspect: https://vercel.com/472590061/vuepress-docs/vmhHRp5REqdVpnA2NWzwpJMQCHtE
✅ Preview: https://vuepress-docs-git-fork-skychx-fix-fix-header-style-472590061.vercel.app

vt – ./

🔍 Inspect: https://vercel.com/472590061/vt/CtZMNhjdJTFdZv5rnSYhKsQA2xzD
✅ Preview: https://vt-git-fork-skychx-fix-fix-header-style-472590061.vercel.app

ulivz commented 2 years ago

Close: https://github.com/ulivz/vt/issues/39