@ilo-org/styles 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,74 +1,186 @@
1
1
  # ILO Design System - Styles Package
2
2
 
3
- ## Status: Proof of Concept
3
+ This package provides the stylesheets which are used to style components in other packages. It does this primarily by supplying a theme and other customization options to the `@ilo-org/styles` package [SASS](https://sass-lang.com/). It has dependencies on the following other @ilo-org packages:
4
4
 
5
- This package provides the stylesheets which are used to style components in other packages. It does this primarily by supplying a theme and other customization options to the `@un/styles` package [SASS](https://sass-lang.com/). It also includes custom css for components in cases where the desired styles can't be achieved only by configuring `@un/styles`.
5
+ - [@ilo-org/themes](./packages/themes)
6
+ - [@ilo-org/fonts](./packages/fonts)
7
+ - [@ilo-org/icons](./packages/icons)
6
8
 
7
- ## Prefixing
9
+ ## Installation and PNPM Commands
8
10
 
9
- All stylesheets in `@un/core` are prefixed via SASS variables. This prefix should correspond with the one used in the component classnames in order for styles to be configured correctly. To see prefixes:
11
+ To install
10
12
 
11
- ```scss
12
- // Set prefix on default styles
13
- @use "@un/styles/scss/config" with (
14
- $prefix: "ilo"
15
- );
13
+ ```bash
14
+ npm i @ilo-org/styles
15
+ ```
16
+
17
+ To build
16
18
 
17
- // Set prefix on default theme options
18
- @use "@un/themes/scss/themes" as themes with (
19
- $custom-property-prefix: "ilo"
20
- );
19
+ ```bash
20
+ pnpm build
21
21
  ```
22
22
 
23
- ## CSS Reset
23
+ To minify
24
+
25
+ ```bash
26
+ pnpm minify
27
+ ```
24
28
 
25
- `@un/styles` includes a basic CSS reset that can be added like this.
29
+ To test formatting
26
30
 
27
- ```scss
28
- @forward "@un/styles/scss/reset";
31
+ ```bash
32
+ pnpm format
29
33
  ```
30
34
 
31
- ## Theming
35
+ To test formatting and fix errors
32
36
 
33
- UN Core is based on IBM Carbon, so themeing [works the same way](https://www.carbondesignsystem.com/guidelines/themes/overview/#customizing-a-theme).
37
+ ```bash
38
+ pnpm format:fix
39
+ ```
34
40
 
35
- [Here is an example](./scss/_theme.scss) of the theme used in this POC, which essentially just WFP's theme with a few values changed. Below shows how we use the theme to customize styles.
41
+ To lint
36
42
 
37
- As you can see, a theme is simply a large map of style tokens which are consumed at various places by the `@un/styles` packages.
43
+ ```bash
44
+ pnpm lint
45
+ ```
38
46
 
39
- ```scss
40
- // Import our own theme settings
41
- @use "theme" as theme;
47
+ To test formatting and fix errors
42
48
 
43
- // Apply the theme settings to the default styles
44
- $carbon--theme: theme.$carbon--theme--ilo;
45
- :root {
46
- @include themes.carbon--theme(theme.$carbon--theme--ilo, true) {
47
- }
48
- }
49
+ ```bash
50
+ pnpm lint:fix
49
51
  ```
50
52
 
51
- ## Styling components
53
+ ## Questions and Feedback
54
+
55
+ (TBD)
56
+
57
+ ## Accessibility Standards
58
+
59
+ (TBD)
60
+
61
+ ## Contributing
62
+
63
+ ILO Design System is an open-source project and we welcome your contributions! Before submitting a pull request, please take a moment to review the following guidelines.
64
+
65
+ ### Branches
66
+
67
+ | Branch | Purpose |
68
+ | --------- | ---------------------------------- |
69
+ | `main` | The latest version of all packages |
70
+ | `develop` | The next release of all packages |
71
+
72
+ ### Contribution workflow
73
+
74
+ 1. Fork and clone the repo
75
+ 2. Create a new branch from the `develop` branch
76
+ 3. Make your changes and [add a changeset](#versioning) identifying the changes and affected packages
77
+ 4. Push your branch to the forked version of the repo
78
+ 5. Open a pull request back to the `develop` branch of the main repo
52
79
 
53
- We can accomplish a lot by customizing style tokens, but we will probably also need to apply more specific styles to components.
80
+ ### Versioning
54
81
 
55
- ### Applying styles
82
+ The project uses [changesets](https://github.com/changesets/changesets) to manage package versioning. All pull requests that will affect the project's semantic versioning must include a changest.
56
83
 
57
- We can use the default styles for an individual component simply by adding its scss from the `@un/styles` package.
84
+ See more information on [how to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
85
+
86
+ ### Conventions
87
+
88
+ Contributions should respect the following conventions for branch names, commit messages and pull request descriptions
89
+
90
+ #### Commits
91
+
92
+ Commits should follow [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#commit).
58
93
 
59
- ```css
60
- @forward "@un/styles/scss/components/button";
94
+ ```
95
+ <type>(<scope>): <subject>
61
96
  ```
62
97
 
63
- Note that some components (like Button) may also have their own set of tokens that we can customize like this:
98
+ Examples:
64
99
 
65
- ```scss
66
- @use "@un/styles/scss/components/button" with (
67
- $button-height: 2.5rem,
68
- $button-border-radius: 2px,
69
- $button-padding: 5px,
70
- $button-padding-lg: 0
71
- );
72
100
  ```
101
+ fix(react): change button color on hover
102
+ feat(twig): add button component
103
+ ci(github): add release workflow
104
+ perf(react): improve modal animations
105
+ ```
106
+
107
+ #### Types
73
108
 
74
- Obviously, in addition to this, we can override or apply new styles to the component simply by writing our own stylesheets for them. There may be cases where we don't even want to use the default styles, and so we can forgo importing them for a given component.
109
+ - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
110
+ - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
111
+ - docs: Documentation only changes
112
+ - feat: A new feature
113
+ - fix: A bug fix
114
+ - perf: A code change that improves performance
115
+ - refactor: A code change that neither fixes a bug nor adds a feature
116
+ - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
117
+ - test: Adding missing tests or correcting existing tests
118
+
119
+ #### Scopes
120
+
121
+ This should be a package name or an aspect of the project's configuration.
122
+
123
+ ### Branches
124
+
125
+ Branch names should broadly mirror the same convention as commits.
126
+
127
+ Examples:
128
+
129
+ ```
130
+ feat/react/modal-wrapper
131
+ fix/twig/modal-wrapper
132
+ ```
133
+
134
+ ### Pull requests
135
+
136
+ Pull requests should include a descriptive name and detailed explanation of what merging the pull request will accomplish. Authors should make sure to reference Github issues that the the pull request will fix or affect.
137
+
138
+ ## Building the project
139
+
140
+ Use [nvm](https://github.com/nvm-sh/nvm) to make sure you have the correct version of node installed.
141
+
142
+ ```bash
143
+ nvm use
144
+ ```
145
+
146
+ Install [pnpm](https://pnpm.io/).
147
+
148
+ ```bash
149
+ npm i -g pnpm
150
+ ```
151
+
152
+ Install dependencies
153
+
154
+ ```bash
155
+ pnpm recursive install
156
+ ```
157
+
158
+ Build all packages.
159
+
160
+ ```bash
161
+ pnpm build:all
162
+ ```
163
+
164
+ Start React storybook
165
+
166
+ ```bash
167
+ pnpm start:react-storybook
168
+ ```
169
+
170
+ Start Twig storybook
171
+
172
+ ```bash
173
+ pnpm start:twig-storybook
174
+ ```
175
+
176
+ Check types
177
+
178
+ ```bash
179
+ pnpm check:types
180
+ ```
181
+
182
+ Run all tests
183
+
184
+ ```bash
185
+ pnpm test:all
186
+ ```