Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
Save
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrwM committed Oct 23, 2020
1 parent c24e590 commit ffb20ea
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ $-btn-subtle-styles: (
position: relative;
min-height: ($-padding-block * 2 + sage-line-height(md));
padding: $-padding-block sage-spacing(sm);
text-align: left; // Prevents text alignment issue when inner text is truncated
border: 0;
border-radius: $-btn-border-radius;
transition: $-btn-transition;
Expand Down Expand Up @@ -229,7 +230,7 @@ $-btn-subtle-styles: (
// Shadow appears on Primary by default but can be toggled off with `--no-shadow`
@if ($-style-name == primary) {
box-shadow: $-btn-shadow-base;

&.sage-btn--no-shadow {
box-shadow: none;
}
Expand Down Expand Up @@ -264,13 +265,13 @@ $-btn-subtle-styles: (
color: map-get($-styles, hover);
background-color: transparent;
}

&:focus,
&:active {
color: map-get($-styles, focus);
background-color: transparent;
}

&:disabled,
&[aria-disabled="true"] {
color: map-get($-styles, disabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ $-collapse-breakpoint-key: md-max;
display: grid;
align-items: stretch;
grid-template-rows: repeat(auto-fit, auto);
grid-column-gap: sage-spacing(sm);
grid-column-gap: sage-spacing(xs);
padding: 0 sage-spacing(sm);
background: sage-color(white);
will-change: background, box-shadow;
padding: 0 sage-spacing(sm);
border-left: sage-border();
border-right: sage-border();

Expand All @@ -37,9 +37,8 @@ $-collapse-breakpoint-key: md-max;
// small datasets, Categories have a larger height than
// regular Outline Items
//
// stylelint-disable order/properties-order
// stylelint-disable-next-line order/properties-order
height: 100%;
// stylelint-enable order/properties-order

@media (min-width: sage-breakpoint($-collapse-breakpoint-key)) {
// Using static column values to ensure alignment
Expand All @@ -55,11 +54,9 @@ $-collapse-breakpoint-key: md-max;
". actions-primary . handle-collapse";
}

// ------------------------------------------------------------------

// ------------------ TOP LEVEL CATEGORY
// ------------------ ( /Category )
&.sage-outline-item--depth-0.sage-outline-item--category {
margin-top: sage-spacing(sm);
margin-top: sage-spacing(xs);
border-top-right-radius: sage-border(radius);
border-top-left-radius: sage-border(radius);
border-top: sage-border();
Expand All @@ -71,7 +68,7 @@ $-collapse-breakpoint-key: md-max;
}
}

// ------------------ TOP LEVEL POST
// ------------------ ( /Category/Post )
&.sage-outline-item--depth-1:not(.sage-outline-item--category) {
border-bottom: sage-border(light);

Expand All @@ -82,20 +79,20 @@ $-collapse-breakpoint-key: md-max;
}
}

// ------------------ 2ND LEVEL CATEGORY
// ------------------ ( /Category/Category )
&.sage-outline-item--depth-1.sage-outline-item--category {
padding-left: sage-spacing(lg);
margin-top: rem(-1px);
border-top: sage-border();
border-bottom: sage-border();
margin-top: rem(-1px);

&.sage-outline-item--last-child:not(.sage-outline-item--expanded) {
border-bottom-right-radius: sage-border(radius);
border-bottom-left-radius: sage-border(radius);
}
}

// ------------------ 2ND LEVEL POST
// ------------------ ( /Category/Category/Post )
&.sage-outline-item--depth-2:not(.sage-outline-item--category) {
padding-left: sage-spacing(xl);
border-bottom: sage-border(light);
Expand All @@ -105,12 +102,14 @@ $-collapse-breakpoint-key: md-max;
}
}

// ------------------------------------------------------------------

&.sage-outline-item--is-dragging,
&.sage-outline-item--is-dragging-descendant {
margin: 0;

// stylelint-disable-next-line declaration-no-important
border: 1px solid sage-color(grey) !important;

// stylelint-disable-next-line declaration-no-important
border-radius: unset !important;

// NOTE: Forces hardware acceleration, this resolves issue with HTML5 Drag & Drop
Expand All @@ -126,7 +125,7 @@ $-collapse-breakpoint-key: md-max;
}

> * {
opacity: 0.75;
opacity: 0.5;
}
}

Expand All @@ -135,23 +134,18 @@ $-collapse-breakpoint-key: md-max;
}

&.sage-outline-item--is-droptarget-invalid {
box-shadow: 0 -4px 0 0 sage-color(red, 300), inset 0 0 0 2px sage-color(red, 300);
box-shadow: 0 -4px 0 0 sage-color(red, 300);
}
}

.sage-outline-item__title {
display: flex;
grid-area: title;
color: sage-color(charcoal, 400);
align-items: center;
display: flex;
@include truncate;
min-width: 0;

.sage-outline-item--category & {
@extend %t-sage-body-semi;
}

:not(.sage-outline-item--category) & {
@extend %t-sage-body;
> * {
max-width: 100%;
}
}

Expand All @@ -161,6 +155,10 @@ $-collapse-breakpoint-key: md-max;
flex-direction: row;
align-items: center;

> * {
margin-right: sage-spacing();
}

@media (min-width: sage-breakpoint($-collapse-breakpoint-key)) {
display: none;
visibility: hidden;
Expand All @@ -175,9 +173,9 @@ $-collapse-breakpoint-key: md-max;
}

.sage-outline-item__actions-primary {
display: flex;
grid-area: actions-primary;
align-items: center;
display: flex;
}

.sage-outline-item__status {
Expand All @@ -189,9 +187,9 @@ $-collapse-breakpoint-key: md-max;
}

.sage-outline-item__handle-drag {
display: flex;
grid-area: handle-drag;
align-items: center;
display: flex;
cursor: grab;

&:active {
Expand Down Expand Up @@ -223,6 +221,7 @@ $-collapse-breakpoint-key: md-max;
display: flex;
grid-area: handle-collapse;
justify-content: flex-end;
align-items: center;
}

.sage-outline-item__children {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<section class="
<section
style="height: 64px;" <%# This height is handled dynamically in React by a containing element %>
class="
sage-outline-item
<%= "sage-outline-item--category" if component.category %>
<%= "sage-outline-item--depth-#{component.depth}" if component.depth %>
Expand All @@ -12,7 +14,12 @@
title="Click to drag"
></div>
<h1 class="sage-outline-item__title">
<%= component.title %>
<%= sage_component SageButton, {
value: component.title,
style: "secondary",
subtle: true,
small: !component.category
} %>
</h1>
<% if component.actions_primary %>
<div class="sage-outline-item__actions-primary">
Expand Down

0 comments on commit ffb20ea

Please sign in to comment.