Skip to content

Commit

Permalink
Rework navbar
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Oct 24, 2023
1 parent fd91d3e commit f664238
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 63 deletions.
36 changes: 34 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,45 @@ module.exports = {
to: 'https://k3s-io.github.io/docs',
position: 'right',
label: 'Docs',
className: 'navbar__docs',
className: 'navbar__icon navbar__docs',
},
{
to: 'https://github.com/k3s-io/k3s/',
label: 'GitHub',
position: 'right',
className: 'navbar__github btn btn-secondary icon-github',
className: 'navbar__icon navbar__github',
},
{
type: 'dropdown',
label: 'More From SUSE',
position: 'right',
className: 'navbar__docs',
items: [
{
label: 'Rancher',
to: 'https://www.rancher.com',
className: 'navbar__icon navbar__rancher',
},
{
label: 'Rancher Desktop',
to: "https://rancherdesktop.io",
className: 'navbar__icon navbar__rd',
},
{
label: 'Longhorn',
to: "https://longhorn.io",
className: 'navbar__icon navbar__longhorn',
},
{
type: 'html',
value: '<hr style="margin: 0.3rem 0;">',
},
{
label: 'More Projects...',
to: "https://opensource.suse.com",
className: 'navbar__icon navbar__suse',
},
],
},
],
},
Expand Down
62 changes: 1 addition & 61 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/
/* Import fonts. */
@import "icon_dropdown.css";

/* poppins */
@font-face {
Expand Down Expand Up @@ -107,66 +107,6 @@ hr {
height: 40px;
}

.btn.navbar__github {
display: inline-block;
font-weight: 400;
color: #212529;
text-align: center;
vertical-align: middle;
user-select: none;
background-color: initial;
border: 2px solid transparent;
padding: .375rem .75rem;
font-size: 1rem;
line-height: 1.66;
border-radius: 3px;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

a.btn.navbar__github {
border: 2px solid transparent;
padding: 8px 20px 7px 47px;
font-size: 1rem;
line-height: 1.66;
font-weight: 400;
position: relative;
font-family: poppins,sans-serif;
text-decoration: none;
align-items: center;
border-radius: 3px;
}

.clear-btn {
padding: 100px;
}

.btn-secondary.navbar__github:hover {
color: #fff;
background-color: #273230;
border-color: #222a29;
}

a.btn.navbar__github::before {
content: "";
background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20.5 20%22%3E%3Cdefs/%3E%3Cpath fill=%22%23fff%22 d=%22M10.3.0C4.6.0.0 4.6.0 10.3c0 4.4 2.8 8.3 7 9.7.5.1.7-.2.7-.5v-1.9c-2.6.5-3.2-.6-3.4-1.2-.2-.6-.6-1.1-1-1.5-.4-.2-.9-.7.0-.7.7.1 1.3.5 1.6 1 .6 1.1 1.9 1.4 3 .8.0-.5.3-1 .7-1.4-2.3-.3-4.7-1.1-4.7-5.1.0-1 .4-2 1.1-2.8-.5-.6-.5-1.6-.1-2.5.0.0.9-.3 2.8 1.1 1.7-.5 3.4-.5 5.1.0 2-1.3 2.8-1.1 2.8-1.1.4.9.5 1.9.2 2.8.7.7 1.1 1.7 1.1 2.8.0 3.9-2.4 4.8-4.7 5.1.5.5.7 1.2.7 1.9v2.8c0 .3.2.6.7.5 5.4-1.8 8.3-7.6 6.5-13C18.6 2.8 14.7.0 10.3.0z%22/%3E%3C/svg%3E");
height: 20px;
width: 20px;
position: absolute;
left: 15px;
top: 10px;
}

.icon-github.navbar__github {
margin-left: 20px;
}

.btn-secondary.navbar__github {
color: #fff!important;
border-color: #384745;
background-color: #384745;
box-shadow: inset 0 1px rgb(255 255 255 / 15%), 0 1px 1px rgb(0 0 0 / 8%);
}

.docusaurus-highlight-code-line {
background-color: rgb(72, 77, 91);
display: block;
Expand Down
87 changes: 87 additions & 0 deletions src/css/icon_dropdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

.navbar__icon {
font-size: 16px;
}

.navbar__icon:before {
content: "";
display: inline-flex;
height: 20px;
width: 35px;
margin-right: 4px;
padding-bottom: 7px;
background-color: var(--ifm-navbar-link-color);
}

.navbar__docs {
font-size: 18px;
}

.navbar__docs:hover:before {
background-color: var(--ifm-link-color);
}

.navbar__docs:before {
mask: url(/static/img/icon-docs-mask.png) no-repeat 100% 100%;
mask-size: cover;
height: 20px;
width: 30px;
padding-right: 1px;
padding-bottom: 9px;
}

.navbar__github {
font-size: 18px;
}

.navbar__github:hover:before {
background-color: var(--ifm-link-color);
}

.navbar__github:before {
mask: url(/static/img/icon-github-mask.png) no-repeat 100% 100%;
mask-size: cover;
height: 19px;
width: 22px;
padding-right: 1px;
padding-bottom: 4px;
}

.navbar__rancher:hover:before {
background-color: #2e68e9;
}
.navbar__rancher:before {
mask: url(/static/img/icon-rancher-mask.png) no-repeat 100% 100%;
mask-size: cover;
height: 14px;
padding-bottom: 2px;
}

.navbar__rd:hover:before {
background-color: #0081be;
}
.navbar__rd:before {
mask: url(/static/img/icon-rd-mask.png) no-repeat 100% 100%;
mask-size: cover;
height: 22px;
}

.navbar__longhorn:hover:before {
background-color: #5f224a;
}
.navbar__longhorn:before {
mask: url(/static/img/icon-longhorn-mask.png) no-repeat 100% 100%;
mask-size: cover;
height: 20px;
padding-bottom: 9px;
}

.navbar__suse:hover:before {
background-color: #30ba78;
}
.navbar__suse:before {
mask: url(/static/img/icon-suse-mask.png) no-repeat 100% 100%;
mask-size: cover;
height: 15px;
padding-bottom: 4px;
}
Binary file added static/img/icon-docs-mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/icon-github-mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/icon-longhorn-mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/icon-rancher-mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/icon-rd-mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/icon-suse-mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f664238

Please sign in to comment.