Skip to content

Commit ae90128

Browse files
committed
feat(devtools): enhance SEO overview with new scoring and styling features
This commit introduces a comprehensive update to the SEO overview section, adding a scoring system for subsections based on issue severity. It includes new styles for the score ring visualization, improving the presentation of SEO health metrics. Additionally, it refactors the issue reporting logic to provide clearer insights into the status of SEO elements, enhancing user experience and accessibility in the SEO tab.
1 parent 38a1d32 commit ae90128

3 files changed

Lines changed: 269 additions & 80 deletions

File tree

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

Lines changed: 99 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -743,69 +743,129 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
743743
font-size: 11px;
744744
color: ${t(colors.gray[500], colors.gray[400])};
745745
`,
746-
seoOverviewSectionList: css`
746+
seoOverviewCheckListCaption: css`
747+
margin: 0 0 8px 0;
748+
font-size: 11px;
749+
line-height: 1.4;
750+
color: ${t(colors.gray[500], colors.gray[400])};
751+
`,
752+
seoOverviewScoreRingWrap: css`
753+
flex-shrink: 0;
754+
display: flex;
755+
align-items: center;
756+
justify-content: center;
757+
`,
758+
seoOverviewScoreRingSvg: css`
759+
display: block;
760+
`,
761+
seoOverviewScoreRingTrack: css`
762+
fill: none;
763+
stroke: ${t(colors.gray[200], colors.gray[700])};
764+
stroke-width: 3;
765+
`,
766+
seoOverviewScoreRingLabel: css`
767+
font-size: 10px;
768+
font-weight: 600;
769+
font-variant-numeric: tabular-nums;
770+
font-family: ${fontFamily.sans};
771+
fill: ${t(colors.gray[800], colors.gray[100])};
772+
`,
773+
seoOverviewCheckList: css`
747774
display: flex;
748775
flex-direction: column;
749-
gap: 4px;
776+
border: 1px solid ${t(colors.gray[200], colors.gray[700])};
777+
border-radius: 8px;
778+
overflow: hidden;
750779
`,
751-
seoOverviewSectionButton: css`
780+
seoOverviewCheckRow: css`
752781
display: flex;
753782
align-items: center;
754-
gap: 10px;
783+
gap: 12px;
755784
width: 100%;
785+
margin: 0;
786+
padding: 9px 10px;
756787
text-align: left;
757-
padding: 8px 10px;
758-
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
759-
border-radius: 6px;
788+
border: none;
789+
border-bottom: 1px solid ${t(colors.gray[100], colors.gray[800])};
760790
background: ${t(colors.white, colors.darkGray[900])};
761-
cursor: pointer;
762791
color: ${t(colors.gray[900], colors.gray[100])};
763792
font-size: 13px;
764793
font-family: inherit;
794+
cursor: pointer;
795+
transition: background 0.1s ease;
796+
797+
&:last-child {
798+
border-bottom: none;
799+
}
800+
801+
&:hover {
802+
background: ${t(colors.gray[50], colors.gray[800] + '55')};
803+
}
804+
805+
&:focus {
806+
outline: none;
807+
}
808+
809+
&:focus-visible {
810+
position: relative;
811+
z-index: 1;
812+
box-shadow: inset 0 0 0 2px ${t(colors.blue[500], colors.blue[400])};
813+
}
765814
`,
766-
seoOverviewSectionIcon: css`
767-
flex-shrink: 0;
768-
width: 20px;
769-
height: 20px;
770-
border-radius: 4px;
815+
seoOverviewCheckBody: css`
816+
flex: 1;
817+
min-width: 0;
771818
display: flex;
772-
align-items: center;
773-
justify-content: center;
819+
flex-direction: column;
820+
gap: 2px;
821+
`,
822+
seoOverviewCheckTitle: css`
823+
font-weight: 500;
824+
font-size: 13px;
825+
line-height: 1.3;
826+
`,
827+
seoOverviewCheckMeta: css`
774828
font-size: 11px;
775-
font-weight: 700;
829+
line-height: 1.35;
830+
color: ${t(colors.gray[500], colors.gray[400])};
831+
overflow: hidden;
832+
text-overflow: ellipsis;
833+
white-space: nowrap;
776834
`,
777-
seoOverviewSectionIconPass: css`
778-
background: ${t(colors.green[50], '#16a34a18')};
779-
color: #16a34a;
835+
seoOverviewCheckCounts: css`
836+
flex-shrink: 0;
837+
font-family: ${fontFamily.mono};
838+
font-size: 11px;
839+
font-variant-numeric: tabular-nums;
840+
line-height: 1.3;
841+
letter-spacing: -0.02em;
780842
`,
781-
seoOverviewSectionIconError: css`
782-
background: #dc262618;
843+
seoOverviewCheckNError: css`
783844
color: #dc2626;
845+
font-weight: 500;
784846
`,
785-
seoOverviewSectionIconWarn: css`
786-
background: #d9770618;
847+
seoOverviewCheckNWarn: css`
787848
color: #d97706;
788-
`,
789-
seoOverviewSectionIconInfo: css`
790-
background: #2563eb18;
791-
color: #2563eb;
792-
`,
793-
seoOverviewSectionBody: css`
794-
flex-grow: 1;
795-
min-width: 0;
796-
`,
797-
seoOverviewSectionTitle: css`
798849
font-weight: 500;
799-
font-size: 13px;
800850
`,
801-
seoOverviewSectionHint: css`
802-
font-size: 11px;
803-
color: ${t(colors.gray[500], colors.gray[400])};
804-
margin-top: 1px;
851+
seoOverviewCheckNInfo: css`
852+
color: ${t(colors.blue[600], colors.blue[400])};
853+
font-weight: 500;
805854
`,
806-
seoOverviewSectionChevron: css`
855+
seoOverviewCheckNZero: css`
807856
color: ${t(colors.gray[400], colors.gray[600])};
857+
font-weight: 400;
858+
`,
859+
seoOverviewCheckNSep: css`
860+
color: ${t(colors.gray[300], colors.gray[600])};
861+
margin: 0 1px;
862+
font-weight: 400;
863+
`,
864+
seoOverviewCheckChevron: css`
808865
flex-shrink: 0;
866+
color: ${t(colors.gray[400], colors.gray[500])};
867+
font-size: 15px;
868+
line-height: 1.2;
809869
`,
810870
seoHeadingTreeHeaderRow: css`
811871
display: flex;

0 commit comments

Comments
 (0)