Skip to content

Commit b84baf2

Browse files
1 parent 9946353 commit b84baf2

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

templates/devtest/label.tmpl

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{template "base/head" .}}
2+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/devtest.css?v={{AssetVersion}}">
3+
<div class="page-content devtest ui container">
4+
<div>
5+
<h1>Label</h1>
6+
<div class="flex-text-block tw-my-2">
7+
<span class="ui label">simple label</span>
8+
<span class="ui red label">red label</span>
9+
<span class="ui green label">green label</span>
10+
</div>
11+
<div class="flex-text-block tw-my-2">
12+
<span class="ui basic label">basic label</span>
13+
<span class="ui basic red label">basic red label</span>
14+
<span class="ui basic green label">basic green label</span>
15+
</div>
16+
<div class="flex-text-block tw-my-2">
17+
<span class="ui label">long content must be in a non-flex "gt-ellipsis" element, otherwise it won't get ellipsis. very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label</span>
18+
</div>
19+
<div class="flex-text-block tw-my-2">
20+
<span class="ui label"><span class="gt-ellipsis">very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label</span></span>
21+
</div>
22+
<div class="tw-my-2">
23+
<span class="ui label"><span class="gt-ellipsis">very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong label</span></span>
24+
</div>
25+
</div>
26+
</div>
27+
{{template "base/footer" .}}

web_src/css/base.css

+3
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,7 @@ table th[data-sortt-desc] .svg {
13411341
align-items: center;
13421342
gap: .25rem;
13431343
vertical-align: middle;
1344+
min-width: 0;
13441345
}
13451346

13461347
.ui.dropdown .ui.label .svg {
@@ -1357,11 +1358,13 @@ table th[data-sortt-desc] .svg {
13571358
display: flex;
13581359
align-items: center;
13591360
gap: .25rem;
1361+
min-width: 0;
13601362
}
13611363

13621364
/* to override Fomantic's default display: block for ".menu .item", and use a slightly larger gap for menu item content */
13631365
.ui.dropdown .menu.flex-items-menu > .item {
13641366
display: flex !important;
13651367
align-items: center;
13661368
gap: .5rem;
1369+
min-width: 0;
13671370
}

web_src/css/modules/label.css

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
display: inline-flex;
66
align-items: center;
77
gap: .25rem;
8+
min-width: 0;
9+
max-width: 100%; /* since we are using "flex" to align label contents, we also need to limit the x-axis, a label shouldn't be wider than 100% */
810
vertical-align: middle;
911
line-height: 1;
1012
background: var(--color-label-bg);

0 commit comments

Comments
 (0)