From 5c271fa51218d7bd2e22423a3d1928d0a1a21edd Mon Sep 17 00:00:00 2001 From: Harrison Hogg Date: Fri, 1 Mar 2024 16:12:49 +0100 Subject: [PATCH 1/2] Removed inline styling from breadcrumbs Signed-off-by: Harrison Hogg --- .changeset/famous-forks-listen.md | 5 +++++ packages/core-components/api-report.md | 3 +++ .../src/layout/Breadcrumbs/Breadcrumbs.tsx | 14 +++++++++++++- .../src/layout/Breadcrumbs/index.ts | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .changeset/famous-forks-listen.md diff --git a/.changeset/famous-forks-listen.md b/.changeset/famous-forks-listen.md new file mode 100644 index 0000000000..6c5aa683f1 --- /dev/null +++ b/.changeset/famous-forks-listen.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Removed inline styling in breadcrumbs and replaced with a theme targetable class of BreadcrumbsCurrentPage diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index 7641386176..a9372921b2 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -136,6 +136,9 @@ export function Breadcrumbs(props: Props_18): React_2.JSX.Element; // @public (undocumented) export type BreadcrumbsClickableTextClassKey = 'root'; +// @public (undocumented) +export type BreadcrumbsCurrentPageClassKey = 'root'; + // @public (undocumented) export type BreadcrumbsStyledBoxClassKey = 'root'; diff --git a/packages/core-components/src/layout/Breadcrumbs/Breadcrumbs.tsx b/packages/core-components/src/layout/Breadcrumbs/Breadcrumbs.tsx index 0d11068074..49880e203b 100644 --- a/packages/core-components/src/layout/Breadcrumbs/Breadcrumbs.tsx +++ b/packages/core-components/src/layout/Breadcrumbs/Breadcrumbs.tsx @@ -51,6 +51,18 @@ const StyledBox = withStyles( { name: 'BackstageBreadcrumbsStyledBox' }, )(Box); +/** @public */ +export type BreadcrumbsCurrentPageClassKey = 'root'; + +const BreadcrumbsCurrentPage = withStyles( + { + root: { + fontStyle: 'italic', + }, + }, + { name: 'BreadcrumbsCurrentPage' }, +)(Box); + /** * Breadcrumbs component to show navigation hierarchical structure * @@ -88,7 +100,7 @@ export function Breadcrumbs(props: Props) { {hasHiddenBreadcrumbs && ( ... )} - {currentPage} + {currentPage} Date: Fri, 1 Mar 2024 20:26:27 +0100 Subject: [PATCH 2/2] Update .changeset/famous-forks-listen.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/famous-forks-listen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/famous-forks-listen.md b/.changeset/famous-forks-listen.md index 6c5aa683f1..784fec7411 100644 --- a/.changeset/famous-forks-listen.md +++ b/.changeset/famous-forks-listen.md @@ -2,4 +2,4 @@ '@backstage/core-components': patch --- -Removed inline styling in breadcrumbs and replaced with a theme targetable class of BreadcrumbsCurrentPage +Removed inline styling in breadcrumbs and replaced with a theme reachable class of BreadcrumbsCurrentPage