-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WIP: Dropdown menu for language #4862
WIP: Dropdown menu for language #4862
Conversation
The linter is showing the following errors which may be blocking js from building?:
|
I think we probably want the style / experience to be pretty similar to http://scholar.archive.org in the top header |
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.
Please reuse the CSS classes for the dropdowns in the menu (and markup including checkbox). Building these in the same way will cut down on css and js we use on the site and the component functionality is identical which would be a performance win!
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.
Another thing to consider.. since this is a JavaScript only feature, should we build it in Javascript rather than inside the template?
static/css/components/footer.less
Outdated
@@ -123,3 +123,45 @@ div#version-details { | |||
border-radius: 3px; | |||
padding: 8px 10px; | |||
} | |||
|
|||
.dropbtn { |
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 feature doesn't work without javascript from what I can see and footer.less is render blocking. Styles should be loaded inside all.js.
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.
Okay, but from what I have noticed that Browse, More, and Account components do not support keyboard navigation so is there a way to implement it in the current structure?
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.
If not I guess we should make this dropdown keeping keyboard navigation in mind.
Later we can implement the same for other dropdown menus in the header.
@jdlrobson, can you please guide me on how to load styles inside all.js? Do I need to load an external CSS file or write the styles in jquery? |
@mekarpeles If I am not wrong do you want this feature in the top header of openlibrary.org or only the styles should be similar? concept.mp4 |
Put the import inside static/css/js-all.less |
8517d68
to
66e77e5
Compare
@jdlrobson I made a separate less file and imported it inside |
Have you run |
No, only make js and make css |
I suggest adding some console.log statements in openlibrary/plugins/openlibrary/js/index.js and checking the line If you can't work it out, feel free to push up what you have and we can work out why it's not working. |
@jdlrobson Now I am confused 😕. I went to the master branch and did EDIT: I tried adding |
@@ -0,0 +1,55 @@ | |||
.language-component__checkbox { |
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.
Rename to language.less - footer-locale is an instance of this component and reusable
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.
Done.
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.
@jdlrobson strange how does renaming changes the bundlesize.
FAIL static/build/all.js: 128KB > maxSize 128KB (gzip)
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.
#footer-locale is shorter than .language-component__checkbox and gzips better. Bundlesize is checking the size of the CSS file generated from this source code.
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 have id="footer-locale-menu" on the main div.
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 code here is fine. I was responding to your comment about it being stranged that it impacted bundlesize and explaining why that happens.
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.
How should we fix this. Increase bundlesize?
1173c1f
to
0501afc
Compare
Technical
Added a dropdown menu for the Language feature.
Screenshot
Footer_Trim.mp4
Stakeholders