Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想制作一个 Slate 仪表板,其中包含我在其他地方看到的可折叠容器,但我不知道要应用哪种 CSS 样式。
有人可以帮助我了解如何做到这一点吗?
基本策略是将容器的高度设置为 0px,并在其父级具有某个类时将其溢出设置为隐藏。也就是说,在父容器中添加一个条件类,比如{{#if w_toggle.on}}hide-me{{/if}},然后添加看起来像这样的 CSS
{{#if w_toggle.on}}hide-me{{/if}}
.hide-me { #widget-w_child_container { height: 0px !important; overflow: hidden; } }
有关更高级的样式和布局技术,请在文档中找到 Slate 开发最佳实践指南的 UX/UI 考虑部分。