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

Fix blurry breadcrumb text #959

Merged
merged 3 commits into from
Aug 14, 2023
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

### 🐛 Bug Fixes

- Fix blurry text in breadcrumbs ([#959](https://github.com/opensearch-project/oui/pull/959))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Fix blurry text in breadcrumbs ([#959](https://github.com/opensearch-project/oui/pull/959))
- Fix blurry text in breadcrumbs by avoiding skewing text ([#959](https://github.com/opensearch-project/oui/pull/959))


### 🚞 Infrastructure

- Add release workflows ([#134](https://github.com/opensearch-project/oui/pull/133))
Expand Down
49 changes: 28 additions & 21 deletions src/components/breadcrumbs/_breadcrumbs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,30 @@

.ouiBreadcrumb {
display: inline-block;
transform: skewX(20deg);

&:not(.ouiBreadcrumb--last) {
color: $ouiTextSubduedColor;
joshuarrrr marked this conversation as resolved.
Show resolved Hide resolved
color: $ouiBreadcrumbTextColor !important; // sass-lint:disable-line no-important

&:hover {
color: $ouiBreadCrumbHoverColor !important; // sass-lint:disable-line no-important
}
}
}

.ouiBreadcrumb--last {
.ouiBreadcrumbs:not(.ouiBreadcrumbs__inPopover) .ouiBreadcrumb--last {
font-weight: $ouiFontWeightMedium;
}

.ouiBreadcrumb--collapsed {
flex-shrink: 0;
color: $ouiBreadcrumbCollapsedLink;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More link finagling (#624)

color: $ouiBreadcrumbCollapsedLink !important; // sass-lint:disable-line no-important
vertical-align: top !important; // sass-lint:disable-line no-important
}

.ouiBreadcrumb__collapsedLink:hover {
color: $ouiBreadCrumbHoverColor !important; // sass-lint:disable-line no-important
}

.ouiBreadcrumbs__inPopover .ouiBreadcrumb--last {
font-weight: $ouiFontWeightRegular;
color: $ouiColorDarkShade !important; // sass-lint:disable-line no-important
}

.ouiBreadcrumbs--truncate {
white-space: nowrap;
flex-wrap: nowrap;
Expand Down Expand Up @@ -89,18 +83,35 @@
}

.ouiBreadcrumbWrapper {
background-color: $ouiBreadcrumbGrayBackground;
transform: skewX(-20deg);
border-radius: $ouiSizeXS;
position: relative;
z-index: 0;
padding: $ouiSizeXS - 2.5 $ouiSizeL - $ouiSizeXS;
padding-right: $ouiSizeL - $ouiSizeXS + $ouiBreadcrumbSpacing / 2;

&::before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: $ouiBreadcrumbSpacing / 2;
right: $ouiBreadcrumbSpacing / 2;
z-index: -1;

transform: skewX(-20deg);
border-radius: $ouiSizeXS;
}

&:not(.ouiBreadcrumbWrapper--first) {
margin-bottom: $ouiSizeXS; /* 1 */
&:not(.ouiBreadcrumbWrapper--last)::before {
background-color: $ouiBreadcrumbGrayBackground;
}

&:not(.ouiBreadcrumbWrapper--last),
&.ouiBreadcrumbWrapper--first.ouiBreadcrumbWrapper--last {
margin-right: $ouiBreadcrumbSpacing;
&.ouiBreadcrumbWrapper--last::before {
background-color: $ouiBreadcrumbBlueBackground;
}

&:not(.ouiBreadcrumbWrapper--first) {
margin-bottom: $ouiSizeXS; /* 1 */
joshuarrrr marked this conversation as resolved.
Show resolved Hide resolved
padding-left: $ouiSizeL - $ouiSizeXS + $ouiBreadcrumbSpacing / 2;
}
}

Expand All @@ -114,7 +125,3 @@
.ouiBreadcrumbWall--single {
background-image: linear-gradient(to right, $ouiBreadcrumbBlueBackground 0 $ouiSizeM, transparent $ouiSizeM);
}

.ouiBreadcrumbWrapper--last {
background-color: $ouiBreadcrumbBlueBackground;
}
9 changes: 5 additions & 4 deletions src/components/breadcrumbs/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
$ouiBreadcrumbSpacing: $ouiSizeS !default;
$ouiBreadcrumbTruncateWidth: $ouiSize * 10 !default;

$ouiBreadcrumbBlueBackground: #B9D9EB !default;
$ouiBreadcrumbGrayBackground: #D9E1E2 !default;
$ouiBreadcrumbCollapsedLink: #002A3A !default;
$ouiBreadCrumbHoverColor: #535861 !default;
$ouiBreadcrumbBlueBackground: tintOrShade($ouiColorPrimary, 72%, 41%) !default;
$ouiBreadcrumbGrayBackground: tint($ouiColorLightShade, 14%) !default;
joshuarrrr marked this conversation as resolved.
Show resolved Hide resolved
$ouiBreadcrumbCollapsedLink: shadeOrTint($ouiColorPrimaryText, 61%, 20%) !default;
$ouiBreadcrumbTextColor: makeHighContrastColor($ouiTextSubduedColor, $ouiBreadcrumbGrayBackground) !default;
joshuarrrr marked this conversation as resolved.
Show resolved Hide resolved
$ouiBreadCrumbHoverColor: shadeOrTint($ouiBreadcrumbTextColor, 16%, 6%) !default;

/* OUI -> EUI Aliases */
$euiBreadcrumbSpacing: $ouiBreadcrumbSpacing;
Expand Down
10 changes: 0 additions & 10 deletions src/themes/oui-next/oui_next_colors_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ $ouiColorChartBand: tint($ouiColorLightestShade, 2.5%);
$ouiShadowColor: #000;
$ouiShadowColorLarge: #000;

// Breadcrumbs
$ouiBreadcrumbBlueBackground: #163F66;
$ouiBreadcrumbGrayBackground: #4C636F;
$ouiBreadcrumbCollapsedLink: #FFF;
$ouiBreadCrumbHoverColor: #B0B8BB;


/* OUI -> EUI Aliases */
$euiColorGhost: $ouiColorGhost;
Expand Down Expand Up @@ -103,8 +97,4 @@ $euiColorChartLines: $ouiColorChartLines;
$euiColorChartBand: $ouiColorChartBand;
$euiShadowColor: $ouiShadowColor;
$euiShadowColorLarge: $ouiShadowColorLarge;
$euiBreadcrumbBlueBackground: $ouiBreadcrumbBlueBackground;
$euiBreadcrumbGrayBackground: $ouiBreadcrumbGrayBackground;
$euiBreadcrumbCollapsedLink: $ouiBreadcrumbCollapsedLink;
$euiBreadCrumbHoverColor: $ouiBreadCrumbHoverColor;
/* End of Aliases */
10 changes: 0 additions & 10 deletions src/themes/oui/oui_colors_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ $ouiColorChartBand: tint($ouiColorLightestShade, 2.5%);
$ouiShadowColor: #000;
$ouiShadowColorLarge: #000;

// Breadcrumbs
$ouiBreadcrumbBlueBackground: #163F66;
$ouiBreadcrumbGrayBackground: #4C636F;
$ouiBreadcrumbCollapsedLink: #FFF;
$ouiBreadCrumbHoverColor: #B0B8BB;


/* OUI -> EUI Aliases */
$euiColorGhost: $ouiColorGhost;
Expand Down Expand Up @@ -103,8 +97,4 @@ $euiColorChartLines: $ouiColorChartLines;
$euiColorChartBand: $ouiColorChartBand;
$euiShadowColor: $ouiShadowColor;
$euiShadowColorLarge: $ouiShadowColorLarge;
$euiBreadcrumbBlueBackground: $ouiBreadcrumbBlueBackground;
$euiBreadcrumbGrayBackground: $ouiBreadcrumbGrayBackground;
$euiBreadcrumbCollapsedLink: $ouiBreadcrumbCollapsedLink;
$euiBreadCrumbHoverColor: $ouiBreadCrumbHoverColor;
/* End of Aliases */