Skip to content

Commit

Permalink
(HDS-2107) small fixes to style imports which broke new builds, remov…
Browse files Browse the repository at this point in the history
…e normalize.
  • Loading branch information
mrTuomoK committed Feb 1, 2024
1 parent 3a60649 commit 3b639a7
Show file tree
Hide file tree
Showing 71 changed files with 88 additions and 146 deletions.
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"copyfiles": "2.2.0",
"cssnano": "4.1.10",
"hds-design-tokens": "3.4.0",
"normalize.css": "8.0.1",
"postcss": "8.2.15",
"postcss-cli": "8.3.1",
"postcss-import": "12.0.1",
Expand Down
10 changes: 9 additions & 1 deletion packages/core/src/base.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
@import url("normalize.css");
@import url("hds-design-tokens");
@import url("utils/animations.css");
@import url("utils/helpers.css");

/*
* Normalize.css rule
* 1. Prevent adjustments of font size after orientation changes in iOS.
*/

html {
-webkit-text-size-adjust: 100%; /* 1 */
}
1 change: 0 additions & 1 deletion packages/react/.templates/new-component/NewComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import styles from './[-replace-name-capital-].module.scss';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import React, { useEffect, useRef, useState } from 'react';
import uniqueId from 'lodash.uniqueid';
import pickBy from 'lodash.pickby';

// import base styles
import '../../styles/base.css';

import styles from './Accordion.module.scss';
import classNames from '../../utils/classNames';
import { IconAngleDown, IconAngleUp } from '../../icons';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import styles from './Breadcrumb.module.scss';
import { Link } from '../link';
import { IconAngleLeft, IconAngleRight } from '../../icons';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import { LoadingSpinner } from '../loadingSpinner';
import styles from './Button.module.scss';
import classNames from '../../utils/classNames';
Expand Down
11 changes: 1 addition & 10 deletions packages/react/src/components/card/Card.module.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
.card {
--background-color: var(--color-white);
--border-color: var(--color-black-90);
--color: var(--color-black-90);
--border-width: 2px;
--padding-horizontal: var(--spacing-l);
--padding-vertical: var(--spacing-m);

background-color: var(--background-color);
color: var(--color);
padding: var(--padding-vertical) var(--padding-horizontal);
composes: hds-card from 'hds-core/lib/components/card/card.css';
}

.boxShadow {
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import styles from './Card.module.scss';
import classNames from '../../utils/classNames';
import { useTheme } from '../../hooks/useTheme';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useEffect, useRef } from 'react';

// import base styles
import '../../styles/base.css';

import styles from './Checkbox.module.css';
import classNames from '../../utils/classNames';
import mergeRefWithInternalRef from '../../utils/mergeRefWithInternalRef';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/columns/Columns.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import styles from './Columns.module.css';

export type ColumnsProps = React.PropsWithChildren<Record<string, unknown>>;
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/container/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import styles from './Container.module.scss';
import classNames from '../../utils/classNames';

Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/dialog/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { useEffect, RefObject, useCallback, useState, useRef, createRef } from 'react';
import ReactDOM from 'react-dom';

// import base styles
import '../../styles/base.css';

import styles from './Dialog.module.scss';
import classNames from '../../utils/classNames';
import { useTheme } from '../../hooks/useTheme';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/dropdown/combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import isEqual from 'lodash.isequal';
import uniqueId from 'lodash.uniqueid';
import { useVirtual } from 'react-virtual';

// import base styles
import '../../../styles/base.css';

import styles from './Combobox.module.scss';
import { FieldLabel } from '../../../internal/field-label/FieldLabel';
import classNames from '../../../utils/classNames';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/dropdown/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import isEqual from 'lodash.isequal';
import uniqueId from 'lodash.uniqueid';
import { useVirtual } from 'react-virtual';

// import base styles
import '../../../styles/base.css';

import styles from './Select.module.scss';
import { FieldLabel } from '../../../internal/field-label/FieldLabel';
import classNames from '../../../utils/classNames';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/errorSummary/ErrorSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useRef, useEffect } from 'react';

// import base styles
import '../../styles/base.css';

import notificationStyles from '../notification/Notification.module.css';
import errorSummaryStyles from './ErrorSummary.module.scss';
import { IconAlertCircleFill } from '../../icons';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/fieldset/Fieldset.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import styles from './Fieldset.module.scss';
import classNames from '../../utils/classNames';
import { Tooltip } from '../tooltip';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/fileInput/FileInput.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { ChangeEvent, useEffect, useRef, useState } from 'react';
import uniqueId from 'lodash.uniqueid';

// import base styles
import '../../styles/base.css';

import composeAriaDescribedBy from '../../utils/composeAriaDescribedBy';
import classNames from '../../utils/classNames';
import { Button } from '../button';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import styles from './Footer.module.scss';
import { Koros, KorosType } from '../koros';
import classNames from '../../utils/classNames';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { cloneElement, Fragment, isValidElement, MouseEventHandler } from 'react';

// import base styles
import '../../../../styles/base.css';

import styles from './FooterBase.module.scss';
import { Logo } from '../../../logo';
import { IconArrowUp } from '../../../../icons';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../../../styles/base.css';

import styles from './FooterCustom.module.scss';
import classNames from '../../../../utils/classNames';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../../../styles/base.css';

import styles from './FooterGroupHeading.module.scss';
import { MergeElementProps } from '../../../../common/types';
import classNames from '../../../../utils/classNames';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../../../styles/base.css';

import styles from './FooterLink.module.scss';
import { Link } from '../../../link';
import { MergeElementProps } from '../../../../common/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { cloneElement, Fragment, isValidElement } from 'react';

// import base styles
import '../../../../styles/base.css';

import styles from './FooterNavigation.module.scss';
import { getChildElementsEvenIfContainersInbetween } from '../../../../utils/getChildren';
import { FooterVariant } from '../../Footer.interface';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { cloneElement, Fragment, isValidElement } from 'react';

// import base styles
import '../../../../styles/base.css';

import { FooterVariant } from '../../Footer.interface';
import { useMediaQueryLessThan } from '../../../../hooks/useMediaQuery';
import styles from './FooterNavigationGroup.module.scss';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { cloneElement, Fragment, isValidElement } from 'react';

// import base styles
import '../../../../styles/base.css';

import styles from './FooterUtilities.module.scss';
import classNames from '../../../../utils/classNames';
import { getChildElementsEvenIfContainersInbetween } from '../../../../utils/getChildren';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { Fragment, cloneElement, isValidElement } from 'react';

// import base styles
import '../../../../styles/base.css';

import styles from './FooterUtilityGroup.module.scss';
import classNames from '../../../../utils/classNames';
import { getChildElementsEvenIfContainersInbetween } from '../../../../utils/getChildren';
Expand Down
72 changes: 72 additions & 0 deletions packages/react/src/components/header/Header.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,78 @@
--header-margin: var(--spacing-xs);
}

/**
* Normalize.css rules
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/

button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}

/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/

button,
input { /* 1 */
overflow: visible;
}

/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/

button,
select { /* 1 */
text-transform: none;
}

/**
* Correct the inability to style clickable types in iOS and Safari.
*/

button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}

/**
* Remove the inner border and padding in Firefox.
*/

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}

/**
* Restore the focus styles unset by the previous rule.
*/

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}


&.theme-dark {
--color-focus-outline: var(--color-white);
--header-color: var(--color-white);
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { HeaderSearch } from './components/headerSearch';
import { SkipLink } from '../../internal/skipLink';
import { LanguageProvider, LanguageProviderProps } from './LanguageContext';
import { HeaderTheme } from './Header.type';
// import base styles
import '../../styles/base.css';
import styles from './Header.module.scss';
import { useTheme } from '../../hooks/useTheme';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { cloneElement, useCallback, useEffect, useRef, useState } from 'react';
import { v4 as uuidv4 } from 'uuid';

// import base styles
import '../../../../styles/base.css';
import styles from './HeaderLink.module.scss';
import { styleBoundClassNames } from '../../../../utils/classNames';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { cloneElement, isValidElement, useRef, useState } from 'react';

// import base styles
import '../../../../../styles/base.css';
import styles from './HeaderLinkDropdown.module.scss';
import { IconAngleDown, IconAngleLeft, IconAngleRight } from '../../../../../icons';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { cloneElement, isValidElement, useEffect } from 'react';

// import base styles
import '../../../../styles/base.css';

import { useHeaderContext, useSetHeaderContext } from '../../HeaderContext';
import classNames from '../../../../utils/classNames';
import { getChildElementsEvenIfContainersInbetween, getChildrenAsArray } from '../../../../utils/getChildren';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { cloneElement, useEffect } from 'react';

// import base styles
import '../../../../styles/base.css';
import styles from './HeaderUniversalBar.module.scss';
import { HeaderLink } from '../headerLink/HeaderLink';
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/hero/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable prettier/prettier */
import React from 'react';

// import base styles
import '../../styles/base.css';
import styles from './Hero.module.scss';
import classNames from '../../utils/classNames';
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/components/highlight/Highlight.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';

// import core base styles
import 'hds-core';
import '../../styles/base.css';
import classNames from '../../utils/classNames';
import { useTheme } from '../../hooks/useTheme';
import styles from './Highlight.module.scss';
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/imageWithCard/ImageWithCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

// import base styles
import '../../styles/base.css';

import classNames from '../../utils/classNames';
import styles from './ImageWithCard.module.css';

Expand Down
Loading

0 comments on commit 3b639a7

Please sign in to comment.