Skip to content

Commit

Permalink
Ribbon labels now automatically position inside tables #1930
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Aug 14, 2015
1 parent ce23372 commit 9f17381
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
- **Popup** - Fixes issue where variation would not be added to a pre-existing popup even if specified in javascript #26011
- **Transition** - Transition callbacks now all have the correct `this` set. #2758
- **Search** - Calling `show results` programmatically no longer fails when input is not focused #2842
- **Table/Label** - `ribbon labels` will now automatically position themselves when used inside a table #1930

**[Community Bug Fixes](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aissue+milestone%3A2.1.0+is%3Aclosed)**
- **API** - API debug is now `false` by default, like other modules. #2817
Expand Down
13 changes: 10 additions & 3 deletions src/definitions/elements/label.less
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,7 @@ a.ui.label {
border-top-color: inherit;
}



/* Inside Image */
/* Inside Table */
.ui.image > .ribbon.label,
.ui.card .image > .ribbon.label {
position: absolute;
Expand All @@ -388,6 +386,15 @@ a.ui.label {
padding-left: @horizontalPadding;
}

/* Inside Table */
.ui.table td > .ui.ribbon.label {
left: @ribbonTableOffset;
}
.ui.table td > .ui[class*="right ribbon"].label {
left: @rightRibbonTableOffset;
padding-left: @horizontalPadding;
}


/*-------------------
Attached
Expand Down
7 changes: 6 additions & 1 deletion src/themes/default/elements/label.variables
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
@tagTransition: background @labelTransitionDuration @labelTransitionEasing;

/* Ribbon */
@ribbonImageTopDistance: 1rem;
@ribbonTriangleSize: 1.2em;
@ribbonShadowColor: rgba(0, 0, 0, 0.15);

Expand All @@ -135,10 +134,16 @@
@ribbonDistance: ~"calc("@ribbonMargin~" + "@ribbonTriangleSize~")";
@rightRibbonOffset: ~"calc(100% + "@ribbonMargin~" + "@ribbonTriangleSize~")";

@ribbonImageTopDistance: 1rem;
@ribbonImageMargin: -0.05rem; /* Rounding Offset on Triangle */
@ribbonImageOffset: ~"calc("-@ribbonImageMargin~" - "@ribbonTriangleSize~")";
@rightRibbonImageOffset: ~"calc(100% + "@ribbonImageMargin~" + "@ribbonTriangleSize~")";

@ribbonTableMargin: @relativeMini; /* Rounding Offset on Triangle */
@ribbonTableOffset: ~"calc("-@ribbonTableMargin~" - "@ribbonTriangleSize~")";
@rightRibbonTableOffset: ~"calc(100% + "@ribbonTableMargin~" + "@ribbonTriangleSize~")";


/* Colors */
@redTextColor: @white;
@orangeTextColor: @white;
Expand Down

0 comments on commit 9f17381

Please sign in to comment.