Skip to content

Commit 38a1d32

Browse files
committed
feat(devtools): enhance JSON-LD preview with new styling and validation features
This commit introduces new styles for the JSON-LD preview component, improving the visual presentation of structured data. It adds functionality for validating supported schema types and enhances the display of entity previews, including detailed rows for required and recommended fields. Additionally, it refactors the health scoring system to account for missing schema attributes, providing clearer insights into SEO performance. These changes aim to improve user experience and accessibility in the SEO tab.
1 parent 1d51b04 commit 38a1d32

2 files changed

Lines changed: 355 additions & 14 deletions

File tree

packages/devtools/src/styles/use-styles.ts

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,12 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
683683
seoHealthCountInfo: css`
684684
color: ${t(colors.gray[500], colors.gray[400])};
685685
`,
686+
seoJsonLdHealthMissingLine: css`
687+
margin-top: 6px;
688+
font-size: 11px;
689+
line-height: 1.4;
690+
color: ${t(colors.gray[500], colors.gray[400])};
691+
`,
686692
seoOverviewPillsRow: css`
687693
display: flex;
688694
gap: 6px;
@@ -961,6 +967,100 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
961967
font-weight: 600;
962968
color: ${t(colors.gray[800], colors.gray[300])};
963969
`,
970+
seoJsonLdSupportedIntro: css`
971+
margin: 0 0 12px 0;
972+
padding: 10px 12px;
973+
border-radius: 8px;
974+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
975+
background: ${t(colors.gray[50], colors.darkGray[900])};
976+
`,
977+
seoJsonLdSupportedIntroLabel: css`
978+
display: block;
979+
font-size: 11px;
980+
font-weight: 600;
981+
color: ${t(colors.gray[600], colors.gray[400])};
982+
text-transform: uppercase;
983+
letter-spacing: 0.04em;
984+
margin-bottom: 8px;
985+
`,
986+
seoJsonLdSupportedChips: css`
987+
display: flex;
988+
flex-wrap: wrap;
989+
gap: 6px;
990+
`,
991+
seoJsonLdSupportedChip: css`
992+
display: inline-flex;
993+
align-items: center;
994+
padding: 3px 8px;
995+
border-radius: 4px;
996+
font-size: 11px;
997+
font-weight: 500;
998+
font-family: ${fontFamily.mono};
999+
border: 1px solid ${t(colors.gray[200], colors.gray[700])};
1000+
background: ${t(colors.white, colors.darkGray[800])};
1001+
color: ${t(colors.gray[800], colors.gray[200])};
1002+
`,
1003+
seoJsonLdCardGrid: css`
1004+
display: flex;
1005+
flex-direction: column;
1006+
gap: 8px;
1007+
margin-bottom: 10px;
1008+
`,
1009+
seoJsonLdEntityCard: css`
1010+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
1011+
border-radius: 8px;
1012+
padding: 8px 10px;
1013+
background: ${t(colors.white, colors.darkGray[800])};
1014+
`,
1015+
seoJsonLdEntityCardHeader: css`
1016+
font-size: 11px;
1017+
font-weight: 700;
1018+
color: ${t(colors.blue[700], colors.blue[400])};
1019+
margin-bottom: 6px;
1020+
font-family: ${fontFamily.mono};
1021+
`,
1022+
seoJsonLdEntityCardRows: css`
1023+
display: flex;
1024+
flex-direction: column;
1025+
gap: 4px;
1026+
font-size: 11px;
1027+
line-height: 1.4;
1028+
`,
1029+
seoJsonLdEntityCardRow: css`
1030+
display: flex;
1031+
gap: 6px;
1032+
align-items: baseline;
1033+
min-width: 0;
1034+
`,
1035+
seoJsonLdEntityCardKey: css`
1036+
flex-shrink: 0;
1037+
color: ${t(colors.gray[500], colors.gray[500])};
1038+
font-weight: 500;
1039+
`,
1040+
seoJsonLdEntityCardValue: css`
1041+
color: ${t(colors.gray[900], colors.gray[100])};
1042+
word-break: break-word;
1043+
min-width: 0;
1044+
`,
1045+
seoJsonLdRawDetails: css`
1046+
margin-top: 4px;
1047+
border-radius: 6px;
1048+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
1049+
overflow: hidden;
1050+
`,
1051+
seoJsonLdRawSummary: css`
1052+
cursor: pointer;
1053+
padding: 6px 10px;
1054+
font-size: 11px;
1055+
font-weight: 500;
1056+
color: ${t(colors.gray[600], colors.gray[400])};
1057+
background: ${t(colors.gray[100], colors.darkGray[800])};
1058+
list-style: none;
1059+
user-select: none;
1060+
&::-webkit-details-marker {
1061+
display: none;
1062+
}
1063+
`,
9641064
seoSocialAccentFacebook: css`
9651065
border-color: #4267b2;
9661066
`,

0 commit comments

Comments
 (0)