{assign var='lineNumber' value=$startLineNumber}
{foreach from=$content item=line}
{if $lineNumbers[$lineNumber]|isset}
- <li id="{@$lineNumbers[$lineNumber]}"><a href="{@$__wcf->getAnchor($lineNumbers[$lineNumber])}" class="lineAnchor"></a>{@$line}</li>
+ <li><span id="{@$lineNumbers[$lineNumber]}" class="codeBoxJumpAnchor"></span><a href="{@$__wcf->getAnchor($lineNumbers[$lineNumber])}" class="lineAnchor"></a>{@$line}</li>
{else}
<li>{@$line}</li>
{/if}
white-space: pre-wrap;
word-break: break-all;
word-wrap: break-word;
+ z-index: 1;
.lineAnchor {
bottom: 0;
top: 0;
width: 3.4em;
}
-
- &:target {
- background-color: rgba(255, 255, 102, 1);
- }
+ }
+ }
+ }
+
+ .codeBoxJumpAnchor:target {
+ height: 100%;
+ pointer-events: none;
+ position: absolute;
+ width: 100%;
+ z-index: -1;
+
+ &::after {
+ background-color: rgba(255, 255, 102, 1);
+ bottom: 0;
+ content: "";
+ display: block;
+ height: 100%;
+ left: 0;
+ position: absolute;
+ right: 0;
+ top: 0;
+ }
+
+ @include screen-md-down {
+ top: -52px;
+
+ &::after {
+ top: 52px;
+ }
+ }
+
+ @include screen-lg {
+ top: -50px;
+
+ &::after {
+ top: 50px;
}
}
}