Skip to content

Commit

Permalink
8710 task: Integrating design system - created separate CSS output fo…
Browse files Browse the repository at this point in the history
…r theme colours and other styles
  • Loading branch information
creido-welly committed Jun 25, 2021
1 parent 28d0dbd commit cd7d571
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 13 deletions.
1 change: 1 addition & 0 deletions .storybook/styles/storybook-app.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import 'styles/core';
@import 'styles/theme';
@import 'styles/common';
@import './storybook-global';
@import './storybook-icons';
3 changes: 2 additions & 1 deletion config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default (async () => ([
*/
{
input: [
'src/styles/core.ts'
'src/styles/core.ts',
'src/styles/theme.ts'
],
output: {
dir: 'dist',
Expand Down
12 changes: 3 additions & 9 deletions src/styles/10-settings/_colours.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

:root {
--colour-black: #000;
--colour-black-rgb: 0, 0, 0;
--colour-white: #fff;
--colour-white-rgb: 255, 255, 255;

--colour-amber-90: #382a00;
--colour-amber-80: #4d3900;
Expand Down Expand Up @@ -58,6 +60,7 @@
--colour-grey-80: #292929;
--colour-grey-70: #5c5c5c;
--colour-grey-60: #767676;
--colour-grey-60-rgb: 118, 118, 118;
--colour-grey-50: #878787;
--colour-grey-40: #999;
--colour-grey-30: #b3b3b3;
Expand Down Expand Up @@ -97,13 +100,4 @@
--colour-yellow-20: #fff9a6;
--colour-yellow-10: #fffde2;
--colour-yellow-05: #fffef0;

--link-colour: var(--colour-blue-60);
--link-colour-hover: var(--colour-blue-70);
--link-colour-focus-outline: var(--colour-blue-40);
--link-colour-active: var(--colour-blue-50);
--link-colour-disabled: var(--colour-grey-50);

--body-text-colour: var(--colour-grey-80);
--meta-text-colour: var(--colour-grey-60);
}
8 changes: 8 additions & 0 deletions src/styles/15-theme/__manifest.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// ----------------------------------
// UI Theme
// ----------------------------------
// Design System 1.0 Alpha
// 2021-05-01
// ----------------------------------

@import 'colours';
18 changes: 18 additions & 0 deletions src/styles/15-theme/_colours.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ----------------------------------
// UI Theme
// Colours
// ----------------------------------
// Design System 1.0 Alpha
// 2021-05-01
// ----------------------------------

:root {
--link-colour: var(--colour-grey-80);
--link-colour-hover: var(--colour-grey-80);
--link-colour-focus-outline: var(--colour-blue-50);
--link-colour-active: var(--colour-grey-80);
--link-colour-disabled: var(--colour-grey-40);

--body-text-colour: var(--colour-grey-80);
--meta-text-colour: var(--colour-grey-60);
}
2 changes: 1 addition & 1 deletion src/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/* stylelint-disable scss/at-import-no-partial-leading-underscore */

// Core variables e.g. base sizes and colors
// Core variables e.g. base sizes and colours
// @import '10-settings/__manifest';

// Core style functions and mixins
Expand Down
10 changes: 8 additions & 2 deletions src/styles/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@

/* stylelint-disable scss/at-import-no-partial-leading-underscore */

// Core variables e.g. base sizes and colors
// Core variables e.g. base sizes and colours
@import '10-settings/__manifest';

// Theme variables e.g. specific colours and typography
// @import '15-theme/__manifest';

// Core style functions and mixins
// @import '20-tools/__manifest';

Expand All @@ -38,9 +41,12 @@
* @see {@link https://www.creativebloq.com/web-design/manage-large-scale-web-projects-new-css-architecture-itcss-41514731}
*/

// Core variables e.g. base sizes and colors
// Core variables e.g. base sizes and colours
// @import '10-settings/__manifest';

// Theme variables e.g. specific colours and typography
// @import '15-theme/__manifest';

// Core style functions and mixins
// @import '20-tools/__manifest';

Expand Down
32 changes: 32 additions & 0 deletions src/styles/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// ----------------------------------
// UI theme
// ----------------------------------
// Design System 1.0 Alpha
// 2021-05-01
// ----------------------------------

/**
* This file serves as the main entry point for the design system's
* standard theme variables (written in .scss).
*
* Unused @imports have been commented out to give a reference point.
*/

/* stylelint-disable scss/at-import-no-partial-leading-underscore */

// Core variables e.g. base sizes and colours
// @import '10-settings/__manifest';

// Theme variables e.g. specific colours and typography
@import '15-theme/__manifest';

// Core style functions and mixins
// @import '20-tools/__manifest';

// More detailed components such as buttons, alerts etc.
// @import '30-components/__manifest';

// Objects e/g grid or media object
// @import '40-objects/__manifest';

/* stylelint-enable scss/at-import-no-partial-leading-underscore */
1 change: 1 addition & 0 deletions src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './theme.scss';

0 comments on commit cd7d571

Please sign in to comment.