Skip to content

Commit

Permalink
style(badge): rearrange badge preview and update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
monicawheeler committed Nov 25, 2024
1 parent b9d3a80 commit 67bca60
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
24 changes: 12 additions & 12 deletions docs/app/views/examples/components/badge/_preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<p>Demonstrates the use of the default badge with various color options.</p>

<%= sage_component SageLabelGroup, { gap: :md, spacer: { bottom: :sm }} do %>
<%= sage_component SageBadge, { color: "locked", value: "Accent" } %>
<%= sage_component SageBadge, { color: "danger", value: "Danger" } %>
<%= sage_component SageBadge, { color: "info", value: "Info" } %>
<%= sage_component SageBadge, { color: "draft", value: "Neutral" } %>
<%= sage_component SageBadge, { color: "info", value: "Info" } %>
<%= sage_component SageBadge, { color: "published", value: "Success" } %>
<%= sage_component SageBadge, { color: "warning", value: "Warning" } %>
<%= sage_component SageBadge, { color: "danger", value: "Danger" } %>
<%= sage_component SageBadge, { color: "locked", value: "Accent" } %>
<% end %>

<%= sage_component SageDivider, {} %>
Expand All @@ -18,32 +18,32 @@
<p>Illustrates a badge with an indicator dot.</p>

<%= sage_component SageLabelGroup, { gap: :md, spacer: { bottom: :sm }} do %>
<%= sage_component SageBadge, { color: "locked", value: "Accent" } do %>
<%= sage_component SageBadge, { color: "draft", value: "Neutral" } do %>
<% content_for :sage_badge_dot do %>
<%= sage_component SageDot, { color: "primary" } %>
<% end %>
<% end %>
<%= sage_component SageBadge, { color: "danger", value: "Danger" } do %>
<%= sage_component SageBadge, { color: "info", value: "Info" } do %>
<% content_for :sage_badge_dot do %>
<%= sage_component SageDot, { color: "primary" } %>
<% end %>
<% end %>
<%= sage_component SageBadge, { color: "info", value: "Info" } do %>
<%= sage_component SageBadge, { color: "published", value: "Success" } do %>
<% content_for :sage_badge_dot do %>
<%= sage_component SageDot, { color: "primary" } %>
<% end %>
<% end %>
<%= sage_component SageBadge, { color: "draft", value: "Neutral" } do %>
<%= sage_component SageBadge, { color: "warning", value: "Warning" } do %>
<% content_for :sage_badge_dot do %>
<%= sage_component SageDot, { color: "primary" } %>
<% end %>
<% end %>
<%= sage_component SageBadge, { color: "published", value: "Success" } do %>
<%= sage_component SageBadge, { color: "danger", value: "Danger" } do %>
<% content_for :sage_badge_dot do %>
<%= sage_component SageDot, { color: "primary" } %>
<% end %>
<% end %>
<%= sage_component SageBadge, { color: "warning", value: "Warning" } do %>
<%= sage_component SageBadge, { color: "locked", value: "Accent" } do %>
<% content_for :sage_badge_dot do %>
<%= sage_component SageDot, { color: "primary" } %>
<% end %>
Expand All @@ -56,12 +56,12 @@
<p>Shows how to create an interactive badge with dropdown functionality.</p>

<%= sage_component SageLabelGroup, { gap: :md, spacer: { bottom: :sm }} do %>
<%= sage_component SageBadge, { color: "locked", value: "Accent", interactive_type: :dropdown } %>
<%= sage_component SageBadge, { color: "danger", value: "Danger", interactive_type: :dropdown } %>
<%= sage_component SageBadge, { color: "info", value: "Info", interactive_type: :dropdown } %>
<%= sage_component SageBadge, { color: "draft", value: "Neutral", interactive_type: :dropdown } %>
<%= sage_component SageBadge, { color: "info", value: "Info", interactive_type: :dropdown } %>
<%= sage_component SageBadge, { color: "published", value: "Success", interactive_type: :dropdown } %>
<%= sage_component SageBadge, { color: "warning", value: "Warning", interactive_type: :dropdown } %>
<%= sage_component SageBadge, { color: "danger", value: "Danger", interactive_type: :dropdown } %>
<%= sage_component SageBadge, { color: "locked", value: "Accent", interactive_type: :dropdown } %>
<% end %>

<%= sage_component SageDivider, {} %>
Expand Down
12 changes: 3 additions & 9 deletions packages/sage-assets/lib/stylesheets/components/_badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$-badge-min-height: rem(20px);
$-badge-interactive-icon-size: rem(24px);
$-badge-interactive-icon-size-decor: rem(28px);
$-badge-padding: 1px rem(10px) 1px sage-spacing(xs);
$-badge-padding: 1px sage-spacing(xs);
$-badge-padding-lg: sage-spacing(2xs) rem(12px);
$-badge-border-radius: sage-border(radius-x-large);
$-badge-statuses: (
Expand All @@ -31,17 +31,11 @@ $-badge-statuses: (
&[class*="sage-badge--icon-only"] {
background-color: transparent;
}

&:not(.sage-badge--large) {
.sage-badge__value-text {
letter-spacing: sage-letter-spacing(md);
}
}
}

.sage-badge__value {
@extend %t-sage-body-med;

letter-spacing: sage-letter-spacing(md);
appearance: none;
display: flex;
align-items: center;
Expand All @@ -65,7 +59,7 @@ $-badge-statuses: (
}

.sage-badge--large & {
@extend %t-sage-body-med;
@extend %t-sage-heading-6;
padding: $-badge-padding-lg;
font-family: $-heading-font;

Expand Down
16 changes: 8 additions & 8 deletions packages/sage-assets/lib/stylesheets/dictionary/_tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $sd-sage-color-base-blue-200-classname: "t-sage--color-blue-200";
///
/// color color-base-blue-300-hex
///
$sd-sage-color-base-blue-300-hex: #92c5fd;
$sd-sage-color-base-blue-300-hex: #93c5fd;
///
/// color color-base-blue-300-code
///
Expand Down Expand Up @@ -468,7 +468,7 @@ $sd-sage-color-base-primary-100-classname: "t-sage--color-primary-100";
///
/// color color-base-primary-200-hex
///
$sd-sage-color-base-primary-200-hex: #92c5fd;
$sd-sage-color-base-primary-200-hex: #93c5fd;
///
/// color color-base-primary-200-code
///
Expand Down Expand Up @@ -2028,7 +2028,7 @@ $sd-sage-color-combos-draft-default-foreground-accent: #1a1a19;
///
/// color combos color-combos-draft-default-background
///
$sd-sage-color-combos-draft-default-background: #e4e4e4;
$sd-sage-color-combos-draft-default-background: #f0f0f0;
///
/// color combos color-combos-draft-default-background-accent
///
Expand Down Expand Up @@ -2112,7 +2112,7 @@ $sd-sage-color-combos-info-default-background: #dbe9fe;
///
/// color combos color-combos-info-default-background-accent
///
$sd-sage-color-combos-info-default-background-accent: #92c5fd;
$sd-sage-color-combos-info-default-background-accent: #93c5fd;
///
/// color combos color-combos-info-default-icon-background-accent
///
Expand All @@ -2128,7 +2128,7 @@ $sd-sage-color-combos-info-subtle-foreground-accent: #2463eb;
///
/// color combos color-combos-info-subtle-background
///
$sd-sage-color-combos-info-subtle-background: #92c5fd;
$sd-sage-color-combos-info-subtle-background: #93c5fd;
///
/// color combos color-combos-info-bold-foreground
///
Expand Down Expand Up @@ -2268,7 +2268,7 @@ $sd-sage-color-combos-primary-default-foreground-accent: #fff;
///
/// color combos color-combos-primary-default-background
///
$sd-sage-color-combos-primary-default-background: #92c5fd;
$sd-sage-color-combos-primary-default-background: #93c5fd;
///
/// color combos color-combos-primary-subtle-foreground
///
Expand All @@ -2280,15 +2280,15 @@ $sd-sage-color-combos-primary-subtle-foreground-accent: #fff;
///
/// color combos color-combos-primary-subtle-background
///
$sd-sage-color-combos-primary-subtle-background: #92c5fd;
$sd-sage-color-combos-primary-subtle-background: #93c5fd;
///
/// color combos color-combos-primary-bold-foreground
///
$sd-sage-color-combos-primary-bold-foreground: #fff;
///
/// color combos color-combos-primary-bold-background
///
$sd-sage-color-combos-primary-bold-background: #92c5fd;
$sd-sage-color-combos-primary-bold-background: #93c5fd;

///
/// Map for color combos
Expand Down

0 comments on commit 67bca60

Please sign in to comment.