Skip to content

Commit

Permalink
Version menu: show icon when page is missing (etcd-io#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Nov 25, 2021
1 parent 64a9c82 commit fb7f47d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 42 deletions.
55 changes: 14 additions & 41 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
// add icon to signify that a link is external
// from https://fontawesome.com/v5.15/icons/external-link-alt?style=solid

.td-content a[href^="http://"]:after,
.td-content a[href^="http://"]:after,
.td-content a[href^="https://"]:after {
@extend .fas;
font-size: 50%;
Expand All @@ -228,54 +228,27 @@
}

// ************************************

// Styles for icon in version menu

// Version menu
// ************************************

// style options in Versions drop down on the upper right of the docs so that it's clear if a doc exists for a particular version as not all docs exist in all versions

// establish fontawesome on dropdown:after

a.dropdown-item:after {

font-family: 'Font Awesome\ 5 Free';
position: relative;
bottom: 1px;
padding: 0 3px;
font-size: .7rem;

}

// Document icon is from https://fontawesome.com/v5.15/icons/file-alt?style=solid and signifies a doc exists in a particular version

a.dropdown-item[href*="/docs/"] {

.cncf-vers-menu--item {
&:hover {
background: #a0d0ff linear-gradient(180deg, #1f6897, #1f6897) repeat-x;
color: #fff;
}

&:after {
content: "\f15c";
background: $primary;
color: white;
}
}

// Remove the doc icon from the version numbers in the dropdown that don't have a corresponding doc.
// ~= means that the href value ends in the string specified. Maintainers will have to add new versions as they come out if there aren't docs for that version.
a.dropdown-item[href~="/docs/v2.3/"],
a.dropdown-item[href~="/docs/v3.1/"],
a.dropdown-item[href~="/docs/v3.2/"],
a.dropdown-item[href~="/docs/v3.3/"],
a.dropdown-item[href~="/docs/v3.4/"],
a.dropdown-item[href~="/docs/v3.5/"] {

.cncf-vers-menu--item__not-found {
color: $gray-600;
&:hover {
background:#accff3 linear-gradient(180deg, #deeaf7, #e3ecf5) repeat-x;
color: #222;
background: lighten($primary, 60%);
color: $gray-900;
}

&:after {
content: "";
@extend .fas;
font-size: .8rem;
padding-left: 6px;
content: fa-content($fa-var-home);
color: lighten($primary, 15%);
}
}
2 changes: 1 addition & 1 deletion themes/docsy

0 comments on commit fb7f47d

Please sign in to comment.