-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): bottom nav #2164
feat(ui): bottom nav #2164
Conversation
308635f
to
93c9d1c
Compare
93c9d1c
to
86a63ca
Compare
@bennypowers Please see the Last I checked, I also had to run this in an Ubuntu 18.04 container in Podman to get this to work. I should probably try to improve how these tests are run. Thanks for the PR! I was out of town the past two weeks but I will take a look soon. |
// disables or enables the style | ||
document.body.classList.toggle('bottom-nav', bottomNav); | ||
document.querySelector('.main-content').classList.toggle('bottom-nav', bottomNav); | ||
document.getElementById('main-nav').classList.toggle('bottom-nav', bottomNav); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me why we need to set this in three different places.
Historically, the way I've done this is to toggle the entire <style>
tag itself. You can see some examples here:
pinafore/src/build/template.html
Lines 35 to 44 in b152359
<style id="theGrayscaleStyle" media="only x"> | |
/* Firefox doesn't seem to like applying filter: grayscale() to | |
* the entire body, so we apply individually. | |
*/ | |
img, svg, video, | |
input[type="checkbox"], input[type="radio"], | |
.inline-emoji, .theme-preview { | |
filter: grayscale(100%); | |
} | |
</style> |
pinafore/src/routes/_store/observers/grayscaleObservers.js
Lines 5 to 16 in 16e6634
export function grayscaleObservers (store) { | |
if (!process.browser) { | |
return | |
} | |
store.observe('enableGrayscale', enableGrayscale => { | |
const { instanceThemes, currentInstance } = store.get() | |
const theme = instanceThemes && instanceThemes[currentInstance] | |
style.setAttribute('media', enableGrayscale ? 'all' : 'only x') // disable or enable the style | |
switchToTheme(theme, enableGrayscale) | |
}) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. i'll have to pull up my sleeves and try to get my local env running so i can clean this up
@@ -20,7 +20,7 @@ body { | |||
|
|||
.main-content { | |||
contain: content; // see https://www.w3.org/TR/2018/CR-css-contain-1-20181108/#valdef-contain-content | |||
padding-top: var(--main-content-pad-top); | |||
padding-block-start: var(--main-content-pad-top); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this orthogonal to the PR? Does this have an effect with different languages? (I can't think of any bottom-to-top languages, but I'm sure they exist?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could take it out 🤷
Closing in favor of #2205, thanks for opening this PR! 🙇 |
Closes #202
I had some difficulty testing locally
that was after installing enabling and starting postgres, then
CREATE USER mastodon CREATEDB;
andCREATE USER pinafore CREATEDB;
🤷