Comments (6)
This requires some design feedback first Cc @WordPress/gutenberg-design
I can think of two options:
- Either allow the tabs flex layout to wrap to a new line
- Or establish strict guidelines for 1) the amount of tabs in a narrow sidebar 2) the length of the tabs translatable strings
Three horizontal tabs in a narrow sidebar seem not ideal in the first place.
from gutenberg.
Would it make sense to have a new dedicated label for text-labels-only mode? There are quite a lot of issues related to the feature, perhaps enough that it deserves its own category. I'm not sure that allowing wrapping, or setting best-practice guidelines (since those can be broken by third party consumers) is necessarily the best way to do handle the overflow, and overflow is something you'll see in a slew of places across tabs, block toolbars, popovers, modals on mobile. Would transforming when text doesn't fit be a solution?
from gutenberg.
To me, the root issue for this case and for similar cases in the editor UI is the usage of fixed heights.
On the web, text is supposed to reflow and re-adapt when the container size changes. I would say it's the beauty of the web. Attempting to design a pixel-perfext design with fixed heights and sizes is often pointles and introduces problems. Any container should allow its content to reflow and adapt.
Instead, I see the trend in the editor is to try to adapt the content to the design. It should really work the opposite way. The design should be built around the content.
It is also worth mentioning that, from an accessibility perspective, any layout should support text-only zoom up to 200% without loss of content or functionality. Fixed heights typically break tet-only zoom.
That's the reason why in core all buttons and form controls have been changed to not use fixed heights and now they can scale with text. The saem principle should be used in core, also for the tabs and any other text container that uses fixed heights,
On the other hand, I'd be totally in favor of using shorter labels. Some labels are visually hidden by default and you realize that are too long only when made visible. However, I'm not in favor of providing pairs of labels with an additional bale for 'show button text labels' because:
- The editor should provide equivalent information for all users, regardless of the editor preferences users set, device and assistive technology in use.
- It would double translators work.
See https://core.trac.wordpress.org/changeset/46243
from gutenberg.
I think this is an issue with the Tabs
component, rather than the 'Show button text labels' feature. It should better handle long labels, and adapt more elegantly to narrow spaces.
This is bad, but can probably be improved significantly with one or two small tweaks:
tabs.mp4
Options to try:
- Horizontal scrolling (of only the tab row container)
- Truncate extremely long labels (with tooltip)
A hacky mockup:
tabs.mp4
from gutenberg.
Just noting that horizontal scrolling is never recommended because it isn't a great experience for keyboard users. Also, browsers handle scrollable elements in a different way, see explanation at #45809
Truncating content could be explored but I don't think it's the best option. Rather, the UI should be designed around content.
I'd think all this kind os content manipulation would treat the symptom rather than the actual disease. The root problem is is that a narrow container like a side panel has very limited horizontal space for horizontal tabs.
from gutenberg.
Another option would be to allow tabs to wrap. The current design doesn't particularly lend itself to this though:
![tabs](https://private-user-images.githubusercontent.com/846565/341771592-f9fb6b07-488f-43d1-b216-2a5beef3b56c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5MDE5ODEsIm5iZiI6MTcxOTkwMTY4MSwicGF0aCI6Ii84NDY1NjUvMzQxNzcxNTkyLWY5ZmI2YjA3LTQ4OGYtNDNkMS1iMjE2LTJhNWJlZWYzYjU2Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMlQwNjI4MDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iYTU1NDUxODgyMmQ5YjNjNzE0NDc2NDFiNDY4YzVjOGJkODhjOWU2OTcyNDAyZjBhMDk2NTIzZGQxMTA1OTY3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.UE1t31aPE2HFPgHGyTb5VQPJ6j2nzXtyDqFcEIaR8sk)
A revised visual treatment which doesn't look so clunky when wrapping could be a solution:
![tabs](https://private-user-images.githubusercontent.com/846565/341773599-af6d83ac-61ee-424a-8fd2-3a0cf1824d0a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5MDE5ODEsIm5iZiI6MTcxOTkwMTY4MSwicGF0aCI6Ii84NDY1NjUvMzQxNzczNTk5LWFmNmQ4M2FjLTYxZWUtNDI0YS04ZmQyLTNhMGNmMTgyNGQwYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMlQwNjI4MDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04M2UxODUzYmY4OThmZWMwNWIzZTM4MTlhNGQ0MGMwMWMxMmIwMTE2Y2U2OGJlYjdlMDFlYjc1M2M3ZGNiN2JiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.SqI1LPuH1aCv0iI-yeGBU0iF1pVncfoBuOwh1laz7nI)
But obviously this would have a widespread effect and require careful consideration.
from gutenberg.
Related Issues (20)
- Button Block: Overlapping toolbars while using both link and inline image & alignment that doesn't properly work HOT 1
- Inline popover hides behind metabox HOT 3
- Stabilize Typography Block Supports Keys for WP 6.7
- Group block overrides Navigation Link hover color in the editor
- Cannot read properties of undefined (reading 'store')
- Layout alignment issue due to global padding on wide blocks (WP 6.6 RC1) HOT 2
- WP 6.6 RC1: Custom blocks stopped working
- Block Bindings: Should the bindings logic be moved to core functions instead of using a hook?
- Block Bindings iteration for WordPress 6.7 HOT 2
- Paragraphs in Classic block lose ID during conversion
- Make usage of the `search` icon more consistent and meaningful
- Docs: Create a section about Block Bindings in the Block Editor Handbook
- Query loop: the 'Max page to show' setting doesn't preview in the editor
- Query loop: Clarify the `Max page to show` setting
- Data Views: Rename 'View Options` control to 'Screen Options'
- If the theme folder contains the word `parts`, block template parts provided by the theme can't be customized in the Site Editor
- Navigation block: decouple ESC key JavaScript action from focus trap
- Section styles: improve (or remove) preview HOT 5
- Discussion: standardize slugs for section styles HOT 2
- HTML API: Plans for 6.8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gutenberg.