Skip to content
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

Remove fomantic list module #30281

Merged
merged 10 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,6 @@ a.label,
background-color: var(--color-label-bg);
}

/* fix Fomantic's line-height causing vertical scrollbars to appear */
ul.ui.list li,
ol.ui.list li,
.ui.list > .item,
.ui.list .list > .item {
line-height: var(--line-height-default);
}

.ui.menu {
display: flex;
}
Expand Down Expand Up @@ -456,21 +448,6 @@ ol.ui.list li,
color: var(--color-text-light-2);
}

.ui.list .list > .item .header,
.ui.list > .item .header {
color: var(--color-text-dark);
}

.ui.list .list > .item > .content,
.ui.list > .item > .content {
color: var(--color-text);
}

.ui.list .list > .item .description,
.ui.list > .item .description {
color: var(--color-text);
}

/* replace item margin on secondary menu items with gap and remove both the
negative margins on the menu as well as margin on the items */
.ui.secondary.menu {
Expand Down Expand Up @@ -589,10 +566,6 @@ img.ui.avatar,
aspect-ratio: 1;
}

.ui.divided.list > .item {
border-color: var(--color-secondary);
}

.ui.error.message .header,
.ui.warning.message .header {
color: inherit;
Expand Down
1 change: 1 addition & 0 deletions web_src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@import "./modules/header.css";
@import "./modules/input.css";
@import "./modules/label.css";
@import "./modules/list.css";
@import "./modules/segment.css";
@import "./modules/grid.css";
@import "./modules/message.css";
Expand Down
265 changes: 265 additions & 0 deletions web_src/css/modules/list.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
/* based on Fomantic UI list module, with just the parts extracted that we use. If you find any
unused rules here after refactoring, please remove them. */

.ui.list {
list-style-type: none;
margin: 1em 0;
padding: 0;
font-size: 1em;
}

.ui.list:first-child {
margin-top: 0;
padding-top: 0;
}

.ui.list:last-child {
margin-bottom: 0;
padding-bottom: 0;
}

.ui.list > .item,
.ui.list .list > .item {
display: list-item;
table-layout: fixed;
list-style-type: none;
list-style-position: outside;
padding: 0.21428571em 0;
line-height: var(--line-height-default); /* fix Fomantic's line-height causing vertical scrollbars to appear */
silverwind marked this conversation as resolved.
Show resolved Hide resolved
}

.ui.list > .list > .item::after,
.ui.list > .item::after {
content: "";
display: block;
height: 0;
clear: both;
visibility: hidden;
}

.ui.list .list > .item:first-child,
.ui.list > .item:first-child {
padding-top: 0;
}

.ui.list .list > .item:last-child,
.ui.list > .item:last-child {
padding-bottom: 0;
}

.ui.list .list:not(.icon) {
clear: both;
margin: 0;
padding: 0.75em 0 0.25em 0.5em;
}

.ui.list .list > .item {
padding: 0.14285714em 0;
line-height: inherit;
}

.ui.list .list > .item > i.icon,
.ui.list > .item > i.icon {
display: table-cell;
min-width: 1.55em;
padding-top: 0;
transition: color 0.1s ease;
}
.ui.list .list > .item > i.icon:not(.loading),
.ui.list > .item > i.icon:not(.loading) {
padding-right: 0.28571429em;
vertical-align: top;
}
.ui.list .list > .item > i.icon:only-child,
.ui.list > .item > i.icon:only-child {
display: inline-block;
min-width: auto;
vertical-align: top;
}

.ui.list .list > .item > .image,
.ui.list > .item > .image {
display: table-cell;
background-color: transparent;
vertical-align: top;
}
.ui.list .list > .item > .image:not(:only-child):not(img),
.ui.list > .item > .image:not(:only-child):not(img) {
padding-right: 0.5em;
}
.ui.list .list > .item > .image img,
.ui.list > .item > .image img {
vertical-align: top;
}
.ui.list .list > .item > img.image,
.ui.list .list > .item > .image:only-child,
.ui.list > .item > img.image,
.ui.list > .item > .image:only-child {
display: inline-block;
}

.ui.list .list > .item > .content,
.ui.list > .item > .content {
line-height: 1.14285714;
color: var(--color-text);
}
.ui.list .list > .item > .image + .content,
.ui.list .list > .item > i.icon + .content,
.ui.list > .item > .image + .content,
.ui.list > .item > i.icon + .content {
display: table-cell;
width: 100%;
padding: 0 0 0 0.5em;
vertical-align: top;
}
.ui.list .list > .item > i.loading.icon + .content,
.ui.list > .item > i.loading.icon + .content {
padding-left: calc(0.2857142857142857em + 0.5em);
}
.ui.list .list > .item > img.image + .content,
.ui.list > .item > img.image + .content {
display: inline-block;
width: auto;
}
.ui.list .list > .item > .content > .list,
.ui.list > .item > .content > .list {
margin-left: 0;
padding-left: 0;
}

.ui.list .list > .item .header,
.ui.list > .item .header {
display: block;
margin: 0;
font-family: var(--fonts-regular);
font-weight: var(--font-weight-medium);
color: var(--color-text-dark);
}

.ui.list .list > .item .description,
.ui.list > .item .description {
display: block;
color: var(--color-text);
}

.ui.list > .item a,
.ui.list .list > .item a {
cursor: pointer;
}

.ui.menu .ui.list > .item,
.ui.menu .ui.list .list > .item {
display: list-item;
table-layout: fixed;
background-color: transparent;
list-style-type: none;
list-style-position: outside;
padding: 0.21428571em 0;
line-height: 1.14285714;
silverwind marked this conversation as resolved.
Show resolved Hide resolved
}
.ui.menu .ui.list .list > .item::before,
.ui.menu .ui.list > .item::before {
border: none;
background: none;
}
.ui.menu .ui.list .list > .item:first-child,
.ui.menu .ui.list > .item:first-child {
padding-top: 0;
}
.ui.menu .ui.list .list > .item:last-child,
.ui.menu .ui.list > .item:last-child {
padding-bottom: 0;
}

.ui.horizontal.list {
display: inline-block;
font-size: 0;
}
.ui.horizontal.list > .item {
display: inline-block;
margin-right: 1em;
font-size: 1rem;
}
.ui.horizontal.list:not(.celled) > .item:last-child {
margin-right: 0;
padding-right: 0;
}
.ui.horizontal.list .list:not(.icon) {
padding-left: 0;
padding-bottom: 0;
}
.ui.horizontal.list > .item > .image,
.ui.horizontal.list .list > .item > .image,
.ui.horizontal.list > .item > i.icon,
.ui.horizontal.list .list > .item > i.icon,
.ui.horizontal.list > .item > .content,
.ui.horizontal.list .list > .item > .content {
vertical-align: middle;
}

/* Padding on all elements */
.ui.horizontal.list > .item:first-child,
.ui.horizontal.list > .item:last-child {
padding-top: 0.21428571em;
padding-bottom: 0.21428571em;
}

/* Horizontal List */
.ui.horizontal.list > .item > i.icon,
.ui.horizontal.list .item > i.icons > i.icon {
margin: 0;
padding: 0 0.25em 0 0;
}
.ui.horizontal.list > .item > .image + .content,
.ui.horizontal.list > .item > i.icon,
.ui.horizontal.list > .item > i.icon + .content {
float: none;
display: inline-block;
width: auto;
}
.ui.horizontal.list > .item > .image {
display: inline-block;
}

.ui.list .list > .disabled.item,
.ui.list > .disabled.item {
pointer-events: none;
opacity: var(--opacity-disabled);
}

.ui.list .list > a.item:hover > .icons,
.ui.list > a.item:hover > .icons,
.ui.list .list > a.item:hover > i.icon,
.ui.list > a.item:hover > i.icon {
color: var(--color-text-dark);
}

.ui.list[class*="middle aligned"] .image,
.ui.list[class*="middle aligned"] .content,
.ui.list [class*="middle aligned"] {
vertical-align: middle !important;
}

.ui.divided.list > .item {
border-top: 1px solid var(--color-secondary);
}
.ui.divided.list .list > .item {
border-top: none;
}
.ui.divided.list .item .list > .item {
border-top: none;
}
.ui.divided.list .list > .item:first-child,
.ui.divided.list > .item:first-child {
border-top: none;
}
.ui.divided.list:not(.horizontal) .list > .item:first-child {
border-top-width: 1px;
}

.ui.relaxed.list:not(.horizontal) > .item:not(:first-child) {
padding-top: 0.42857143em;
}
.ui.relaxed.list:not(.horizontal) > .item:not(:last-child) {
padding-bottom: 0.42857143em;
}
Loading