Skip to content

Commit 0afb8a6

Browse files
committed
fix(techdocs): correct colors calculation
Signed-off-by: Thomas Cardonne <thomas.cardonne@adevinta.com>
1 parent 7933a52 commit 0afb8a6

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.changeset/rude-moose-dig.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@backstage/plugin-techdocs': patch
3+
---
4+
5+
Corrected color of some elements such as Grid cards and Tables.

plugins/techdocs/src/reader/transformers/styles/rules/typeset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ ${headings.reduce<string>((style, heading) => {
110110
111111
.md-typeset table:not([class]) {
112112
font-size: var(--md-typeset-font-size);
113-
border: 1px solid var(--md-default-fg-color);
113+
border: 1px solid var(--md-typeset-table-color);
114114
border-bottom: none;
115115
border-collapse: collapse;
116116
border-radius: ${theme.shape.borderRadius}px;
@@ -119,7 +119,7 @@ ${headings.reduce<string>((style, heading) => {
119119
font-weight: bold;
120120
}
121121
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
122-
border-bottom: 1px solid var(--md-default-fg-color);
122+
border-bottom: 1px solid var(--md-typeset-table-color);
123123
}
124124
125125
.md-typeset pre > code::-webkit-scrollbar-thumb {

plugins/techdocs/src/reader/transformers/styles/rules/variables.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ export default ({ theme }: RuleOptions) => `
2828
/* FONT */
2929
--md-default-fg-color: ${theme.palette.text.primary};
3030
--md-default-fg-color--light: ${theme.palette.text.secondary};
31-
--md-default-fg-color--lighter: ${lighten(theme.palette.text.secondary, 0.7)};
32-
--md-default-fg-color--lightest: ${lighten(
33-
theme.palette.text.secondary,
34-
0.3,
35-
)};
31+
--md-default-fg-color--lighter: ${alpha(theme.palette.text.secondary, 0.3)};
32+
--md-default-fg-color--lightest: ${alpha(theme.palette.text.secondary, 0.15)};
3633
3734
/* BACKGROUND */
3835
--md-default-bg-color:${theme.palette.background.default};
@@ -146,7 +143,7 @@ export default ({ theme }: RuleOptions) => `
146143
--md-typeset-font-size: 1rem;
147144
--md-typeset-color: var(--md-default-fg-color);
148145
--md-typeset-a-color: ${theme.palette.link};
149-
--md-typeset-table-color: ${theme.palette.text.primary};
146+
--md-typeset-table-color: ${alpha(theme.palette.text.primary, 0.15)};
150147
--md-typeset-table-color--light: ${alpha(theme.palette.text.primary, 0.05)};
151148
--md-typeset-del-color: ${
152149
theme.palette.type === 'dark'

0 commit comments

Comments
 (0)