<vaadin-horizontal-layout> is vertical, not horizontal - vaadin

I have a question about Vaadin components. I've successfully added them to static web pages using their declarative APIs (HTML APIs). (See https://web-call.cc/ .) The HTML API for element (https://vaadin.com/components/vaadin-ordered-layout/html-examples) shows usage like this:
<vaadin-horizontal-layout>
<div>Item 1</div>
<div>Item 2</div>
</vaadin-horizontal-layout>
but I have to add the style display: flex; to make the layout horizontal. Why must I do that? (I got the idea from viewing the layout with Dev Tools in Chrome, which showed the horizontal layout with that style.) When I added that style rule for both the horizontal layout and the vertical layout, the vertical layout went horizontal, too! The documentation doesn't show that style being applied to the layouts; only to the items contained in those layouts. Am I missing something?

The reason the layouts were misbehaving is that I forgot these imports:
import '#vaadin/vaadin-ordered-layout/vaadin-vertical-layout.js'
import '#vaadin/vaadin-ordered-layout/vaadin-horizontal-layout.js'```

Related

Vaadin flow AppLayout and full height grid as content

I'm currently porting over a vaadin 8 app and wish to use the AppLayout for this. So far everthing is, ok, with one exception.
The AppLayout does not support a full height gri/tree grid as it's main content, as documented in the component guide.
Any work arround this nasty problem?
https://vaadin.com/docs/latest/ds/components/app-layout/#scrolling-behavior
Setting the grid too 100% height and the content to 100% height gives me two scrollbars
To support full height components within App Layout, set its height to 100%.
See the (now updated) documentation for App Layout: https://vaadin.com/docs/latest/ds/components/app-layout/#scrolling-behavior

How can I add a margin to the text editor in visual studio, with information related to the code and which scrolls with the code

The text editor in Visual Studio has several built in margins and it allows you to define your own custom margins.
I would like to implement a margin which shows information about the code lines in the editor, and which scrolls with the text.
There are two obvious examples:
The glyph margin
The line number margin
There are several samples from Microsoft:
Creating a margin glyph (also here on GitHub) shows how to render a symbol in the Glyph Margin, and how to use the tagging system.
There is also a template to create a simple margin in Visual Studio.
It is easy to modify this to create a margin on the left, but this is just a static canvas.
How can I make a custom margin which displays stuff related to the code, and which scrolls with the code like the glyph and the line number margins?
Is there a sample, from Microsoft or anybody else, which shows how to do something like this?

Dynamically change axis in UIStackView

I have 2 views in a horizontal UIStackView. What I'm trying to achieve is for the stack view to stay in horizontal mode if possible, but if this isn't possible then change to a vertical mode. Demonstrated in the image below. When in the second case it can't fit horizontally it changes to vertical:
How could this be achieved using UIStackViews and autolayout?
In a more general sense I would love to have a view that mimics CSS flex-wrap properties. I.e.:
Though that seems like a far more complicated task.

Use jQuery UI Layout to make 2x2 panels

I'm trying to make a clone of jsfiddle. This is a 2x2 layout. I found jQuery-UI Layout which works perfectly... accept it seems to require a "center" pane, which doesn't exist in a 2x2 layout.
How can I disable the "center" pane? Or how can I make a 2x2 panel layout using "jQuery UI-layout" or another plugin?
Simply consider one of your "column" as center pane, and then divide it horizontally in two sub-panes. You have to think it such as a "nested" layout.

CSS3: Add vertical spacing between lines

I have some jQuery UI buttons that look like this:
How can I add vertical spacing between the rows? Modifying the CSS properties margin-top and padding-top didn't work.
Here is the HTML that exemplifies a single button:
<div>
<input type="checkbox" class="tool_toggle" id="tool_#" checked /><label for="tool_#">... tool name...</label>
... more inputs ...
</div>
This HTML input tag is simply repeated 11 times. The buttons wrap around as they should in the div container.
You can do it by setting line-height to the element that contains the buttons.
You need to specify that the buttons are display:inline-block before you can add margin-top or padding-top. This is because inline elements can not have top or bottom margins or padding.
You didnt post enough code to tell for certain so this is a guess. Post your CSS or make a http://jsfiddle.net/ if you want a proper answer

Resources