Skip to content

Instantly share code, notes, and snippets.

@kimhogeling
Last active May 4, 2017 19:25
Show Gist options
  • Save kimhogeling/9033a573cc070178e5b73850177a2161 to your computer and use it in GitHub Desktop.
Save kimhogeling/9033a573cc070178e5b73850177a2161 to your computer and use it in GitHub Desktop.
Fixed menu for audiotheme obsidian theme
/**
* These CSS rules make the menu fixed in audiotheme's obsidian theme (https://demo.audiotheme.com/obsidian/)
* Note that the none-demo page probably does not have a bar above it at the top of the screen,
* which means, that you might need to change the `top: 40px` into `top: 0`.
*/
@media (min-width: 768px) { /* prevent messing up the mobile menu */
#menu-primary-menu {
will-change: transform; /* ensure smooth scrolling */
position: fixed; /* pin the menu bar to the screen */
left: 0; /* menu bar starts at the left of the screen */
top: 40px; /* move the menu bar below the demo bar */
background: rgba(0, 0, 0, 0.8); /* prevent collision of fonts */
max-width: 100%; /* ensure the menu bar takes full width, because of the background */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment