From a7e74149a10d2004b5a206971271a4d6854fe9b3 Mon Sep 17 00:00:00 2001 From: Revanshu Paliwal Date: Wed, 15 Mar 2023 14:29:53 +0100 Subject: [PATCH] SONAR-18755 Validation fixes for MIUI navbar --- .../design-system/src/components/InputSearch.tsx | 8 ++++---- .../design-system/src/components/MainMenuItem.tsx | 2 +- .../src/components/__tests__/MainMenuItem-test.tsx | 6 +++--- server/sonar-web/design-system/src/theme/light.ts | 2 +- .../components/global-search/GlobalSearchResult.tsx | 10 ++++++---- server/sonar-web/src/main/js/app/styles/init/base.css | 2 +- server/sonar-web/src/main/js/app/styles/init/forms.css | 2 +- .../src/main/js/components/controls/buttons.css | 2 -- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/server/sonar-web/design-system/src/components/InputSearch.tsx b/server/sonar-web/design-system/src/components/InputSearch.tsx index 5e5e9c0e3ee..304a1d3dd2c 100644 --- a/server/sonar-web/design-system/src/components/InputSearch.tsx +++ b/server/sonar-web/design-system/src/components/InputSearch.tsx @@ -188,11 +188,11 @@ export const StyledInputWrapper = styled.div` ${tw`sw-rounded-2`} ${tw`sw-box-border`} - ${tw`sw-pl-10`} - ${tw`sw-body-sm`} - ${tw`sw-w-full sw-h-control`} + ${tw`sw-pl-10`} + ${tw`sw-body-sm`} + ${tw`sw-w-full sw-h-control`} - &::placeholder { + &::placeholder { color: ${themeColor('inputPlaceholder')}; ${tw`sw-truncate`} diff --git a/server/sonar-web/design-system/src/components/MainMenuItem.tsx b/server/sonar-web/design-system/src/components/MainMenuItem.tsx index 9749ba9028a..26da3226de9 100644 --- a/server/sonar-web/design-system/src/components/MainMenuItem.tsx +++ b/server/sonar-web/design-system/src/components/MainMenuItem.tsx @@ -34,7 +34,7 @@ export const MainMenuItem = styled.li` color: ${themeContrast('mainBar')}; letter-spacing: 0.03em; - line-height: calc(${LAYOUT_GLOBAL_NAV_HEIGHT}px - 3px); // - 3px border bottom + line-height: calc(${LAYOUT_GLOBAL_NAV_HEIGHT}px - 4px); // - 4px border bottom border-bottom: ${themeBorder('active', 'transparent', 1)}; &:visited { diff --git a/server/sonar-web/design-system/src/components/__tests__/MainMenuItem-test.tsx b/server/sonar-web/design-system/src/components/__tests__/MainMenuItem-test.tsx index b3120afbe71..562613e9ea8 100644 --- a/server/sonar-web/design-system/src/components/__tests__/MainMenuItem-test.tsx +++ b/server/sonar-web/design-system/src/components/__tests__/MainMenuItem-test.tsx @@ -33,7 +33,7 @@ it('should render default', () => { expect(screen.getByText('Hi')).toHaveStyle({ color: 'rgb(62, 67, 87)', - 'border-bottom': '3px solid transparent', + 'border-bottom': '4px solid transparent', }); }); @@ -46,7 +46,7 @@ it('should render active link', () => { expect(screen.getByText('Hi')).toHaveStyle({ color: 'rgb(62, 67, 87)', - 'border-bottom': '3px solid rgba(123,135,217,1)', + 'border-bottom': '4px solid rgba(123,135,217,1)', }); }); @@ -59,6 +59,6 @@ it('should render hovered link', () => { expect(screen.getByText('Hi')).toHaveStyle({ color: 'rgb(42, 47, 64)', - 'border-bottom': '3px solid rgba(123,135,217,1)', + 'border-bottom': '4px solid rgba(123,135,217,1)', }); }); diff --git a/server/sonar-web/design-system/src/theme/light.ts b/server/sonar-web/design-system/src/theme/light.ts index 56aaefd0d3a..7a86822c0b4 100644 --- a/server/sonar-web/design-system/src/theme/light.ts +++ b/server/sonar-web/design-system/src/theme/light.ts @@ -674,7 +674,7 @@ const lightTheme = { // predefined borders borders: { default: ['1px', 'solid', ...COLORS.grey[50]], - active: ['3px', 'solid', ...primary.light], + active: ['4px', 'solid', ...primary.light], focus: ['4px', 'solid', ...secondary.default, OPACITY_20_PERCENT], }, diff --git a/server/sonar-web/src/main/js/app/components/global-search/GlobalSearchResult.tsx b/server/sonar-web/src/main/js/app/components/global-search/GlobalSearchResult.tsx index 71779ed36cd..982f207add5 100644 --- a/server/sonar-web/src/main/js/app/components/global-search/GlobalSearchResult.tsx +++ b/server/sonar-web/src/main/js/app/components/global-search/GlobalSearchResult.tsx @@ -55,10 +55,12 @@ export default class GlobalSearchResult extends React.PureComponent { >
- {component.isFavorite && } - {!component.isFavorite && component.isRecentlyBrowsed && ( - - )} +
+ {component.isFavorite && } + {!component.isFavorite && component.isRecentlyBrowsed && ( + + )} +
diff --git a/server/sonar-web/src/main/js/app/styles/init/base.css b/server/sonar-web/src/main/js/app/styles/init/base.css index 8e3b5d505a4..7df1afe59fa 100644 --- a/server/sonar-web/src/main/js/app/styles/init/base.css +++ b/server/sonar-web/src/main/js/app/styles/init/base.css @@ -30,7 +30,7 @@ } *:focus-visible { - outline: 2px dotted var(--primary400) !important; + outline: 2px dotted var(--primary400); } html, diff --git a/server/sonar-web/src/main/js/app/styles/init/forms.css b/server/sonar-web/src/main/js/app/styles/init/forms.css index d2983bd6b9b..f8b1e25a1c7 100644 --- a/server/sonar-web/src/main/js/app/styles/init/forms.css +++ b/server/sonar-web/src/main/js/app/styles/init/forms.css @@ -54,7 +54,7 @@ textarea:focus, select:focus { border-color: var(--blue); box-shadow: none; - outline: none !important; + outline: none; } input[type='text']:invalid, diff --git a/server/sonar-web/src/main/js/components/controls/buttons.css b/server/sonar-web/src/main/js/components/controls/buttons.css index 1dd0a26769a..eb189f27e98 100644 --- a/server/sonar-web/src/main/js/components/controls/buttons.css +++ b/server/sonar-web/src/main/js/components/controls/buttons.css @@ -34,7 +34,6 @@ font-size: var(--smallFontSize); text-decoration: none; cursor: pointer; - outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; } @@ -107,7 +106,6 @@ background: inherit; color: inherit; cursor: pointer; - outline: none; border: 0; } -- 2.39.5