-
Notifications
You must be signed in to change notification settings - Fork 2
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(frontend): improve open tables drawer design #1404
Conversation
3e9b7ff
to
1b6062d
Compare
1b6062d
to
bb168cc
Compare
bb168cc
to
6f0dc02
Compare
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.
@@ -61,6 +65,6 @@ const toggleDrawer = () => { | |||
.top-menu { | |||
position: sticky; | |||
top: 0; | |||
z-index: 1000; | |||
z-index: 1008; |
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.
There must be a problem if it is necessary to change z-index values like that.
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.
I agree. Just had a quick look at https://www.smashingmagazine.com/2021/02/css-z-index-large-projects and the idea makes sense to me. We are dealing with Vuetify values here, I'll check if there is any way to get those values.
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.
I simplified the structure and got rid of that specific z-index entirely. Was like that before because of requirements which changed.
|
||
<nav | ||
class="v-navigation-drawer v-navigation-drawer--bottom v-navigation-drawer--temporary v-theme--light v-navigation-drawer--mobile menu-drawer px-4 d-md-none" | ||
data-v-cf2c9067="" |
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.
What is data-v-cf2c9067
?
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.
This is what makes scoped CSS work. The tag is afaik generated from the file name or path.
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.
🤦 I was reviewing generated code. Of course, this is how it works with scoped CSS.
<nav | ||
class="v-navigation-drawer v-navigation-drawer--bottom v-navigation-drawer--temporary v-theme--light v-navigation-drawer--mobile menu-drawer px-4 d-md-none" | ||
data-v-cf2c9067="" | ||
style="bottom: 0px; z-index: 1004; transform: translateY(110%); position: fixed; transition: none !important; left: 0px; width: calc(100% - 0px - 0px);" |
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.
Why do we need style
attribute here?
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 generated by Vuetify unfortunately.
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.
Again generated code. But what the heck, Vuetify, style attributes, seriously? They have the highest specificity: https://2019.wattenberger.com/blog/css-cascade#specificity
data-v-cf2c9067="" | ||
style="right: 0px; z-index: 1004; transform: translateX(110%); position: fixed; transition: none !important; height: calc(100% - 70px - 0px); top: 70px; bottom: 0px;" | ||
style="right: 0px; z-index: 1004; transform: translateX(110%); position: fixed; height: calc(100% - 70px - 0px); top: 70px; bottom: 0px; transition: none !important;" |
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 the order important here?
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.
I have no explanation why it changed...
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.
Sorry for that, if it's generated, I pretty much don't care about the order here.
@@ -872,7 +872,7 @@ exports[`TopMenu > renders 1`] = ` | |||
|
|||
<i | |||
aria-hidden="false" | |||
aria-label="$vuetify.input.clear" | |||
aria-label="Löschen" |
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.
I can see a $t('tablesDrawer.noTables')
further down. So we're already translating the app, why not translate this, too?
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.
We are translating this, of course. Apparently the Vuetify internal dictionary entries are resolved for the snapshots. That's a strange behaviour and could lead to problems in CI. Good catch.
Why does it appear now: I corrected the keys in the locales files.
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.
Yes! It's good that it's translated now 🙂 the problems in unit testing is another story.
top: 0 !important; | ||
z-index: 1006 !important; | ||
width: 308px; | ||
height: 100% !important; | ||
padding-top: 70px; | ||
background: var(--v-sidebar-background) !important; | ||
} | ||
|
||
@media #{map-get($display-breakpoints, 'sm-and-down')} { | ||
.menu-drawer { | ||
left: var(--sides) !important; | ||
z-index: 2000 !important; | ||
width: calc(100% - (2 * var(--sides))) !important; |
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.
The sheer amount of !important
s in this block indicate a specificity problem.
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.
Vuetify components that we need to override :/
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.
Vuetify components that we need to override :/
This is exactly the selling point of Tailwind. No more specificity wars. Every component framework that is built on Tailwind is using the same level of specificity. Every template code that we copy+paste will look the same in our application as it does in a sandbox. The nesting template will only pass in CSS that is not specified in the inner template.
Problems solved. Once. And. For. All.
@@ -1,6 +1,6 @@ | |||
{ | |||
"$vuetify": { | |||
"input:": { | |||
"input": { | |||
"clear": "Löschen" |
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.
Why was this not used?
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.
What do you mean? It's used in the search field.
</v-list-item> | ||
</v-list> | ||
</v-card> | ||
<ul class="list"> |
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.
I like that we're using plain HTML when possible 👍
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.
:)
@roschaefer |
@roschaefer |
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.
position: sticky; | ||
top: 0; | ||
z-index: 1008; | ||
.hide-on-mobile { |
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.
This is such a utility class. It shouldn't go into scoped
. I think in tailwind it would be invisible md:visible
.
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.
Yes, I totally agree and will make it global with a better name the next time I'll use it. No, visibility is something different and takes rendering time. md:hidden
would be right, I guess.
🍰 Pullrequest
Styles the open tables drawer according to Figma. Also adds messages in case of no open tables or no search results.
Also fixes these warnings:
Issues
Todo