Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Add ability to text to automatically truncate when space requires #1776

Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions less/checkbox-no-js.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import "forms.less";
.fuelux {
.checkbox, .checkbox-inline {

input[type="checkbox"]:not(.sr-only) {
& ~ label {
&:before {
Expand Down Expand Up @@ -46,4 +46,4 @@
}

}
}
}
11 changes: 11 additions & 0 deletions less/checkbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@
color: @gray60;
}


/* for keyboard tabbing */
input[type="checkbox"] + .checkbox-label {
&.truncate {
display: inherit;
line-height: 14px;
margin-top: 3px;
margin-bottom: -3px;
}
}

}

label.checkbox-custom.checkbox-inline {
Expand Down
9 changes: 9 additions & 0 deletions less/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
}

#fuelux {

// Truncate
.truncate() {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

// Single side border-radius
.border-top-radius(@radius) {
border-top-right-radius: @radius;
Expand Down
11 changes: 11 additions & 0 deletions less/radio.less
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@
input[type="radio"]:focus + .radio-label {
color: @gray60;
}

/* for keyboard tabbing */
input[type="radio"] + .radio-label {
&.truncate {
display: inherit;
line-height: 14px;
margin-top: 3px;
margin-bottom: -3px;
}
}

}

label.radio-custom.radio-inline {
Expand Down
4 changes: 4 additions & 0 deletions less/repeater-list.less
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
&.sorted {
background: @gray98;
}

&.truncate {
display: inherit;
}
}

tr {
Expand Down
8 changes: 7 additions & 1 deletion less/tree.less
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,10 @@

}

}
.truncate .tree {
.tree-branch-header .tree-branch-name, .tree-item .tree-item-name {
#fuelux > .truncate;
}
}

}
11 changes: 9 additions & 2 deletions less/utility.less
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
.margin {
&-xs {
margin: @margin-xs;

&-horizontal {
margin: 0 @margin-xs;
}
Expand Down Expand Up @@ -208,4 +208,11 @@
#fuelux > .section-heading();
}

}


// Truncate
.truncate {
#fuelux > .truncate;
}

}