Skip to content
Open
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
76 changes: 76 additions & 0 deletions src/Elastic.Documentation.Site/Assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,82 @@ body {
@apply text-blue-elastic! font-semibold;
}

/* Grey-10 background for active sections */
#pages-nav li {
position: relative;
}

/* Highlight the active section: parent li and all sibling li elements */
#pages-nav li:has(ul a.current)::before,
#pages-nav li:has(ul a.current) > ul > li::before {
content: '';
position: absolute;
top: -15px;
left: -15px;
right: 0;
bottom: -15px;
@apply bg-grey-10 rounded-sm;
z-index: -2;
}

/* Also highlight when the parent itself is the current item */
#pages-nav li:has(> a.current)::before,
#pages-nav li:has(> a.current) ~ li::before {
content: '';
position: absolute;
top: -15px;
left: -15px;
right: 0;
bottom: -15px;
@apply bg-grey-10 rounded-sm;
z-index: -2;
}

/* Also highlight all children when the parent itself is current */
#pages-nav li:has(> div > a.current)::before,
#pages-nav li:has(> div > a.current) > ul > li::before {
content: '';
position: absolute;
top: -15px;
left: -15px;
right: 0;
bottom: -15px;
@apply bg-grey-10 rounded-sm;
z-index: -2;
}

/* Grey-20 hover effect for all nav links - only direct child link */
#pages-nav li:has(> a:hover):not(:has(> ul))::after,
#pages-nav li:has(> div > a:hover):not(:has(> ul))::after {
content: '';
position: absolute;
top: -8px;
left: -8px;
right: 8px;
bottom: -8px;
@apply bg-grey-20 rounded-sm;
z-index: -1;
}

/* Position the parent link/div containers */
#pages-nav li > a,
#pages-nav li > div {
position: relative;
}

/* For parent items with children, apply hover only to the direct link/div area */
#pages-nav li:has(> a:hover):has(> ul) > a::before,
#pages-nav li:has(> div > a:hover):has(> ul) > div::before {
content: '';
position: absolute;
top: -8px;
left: -15px;
right: 0;
bottom: -8px;
@apply bg-grey-20 rounded-sm;
z-index: -1;
}

.markdown-content {
@apply font-body;
}
Expand Down
Loading