@ilo-org/styles 0.2.1 → 0.3.0

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,186 +1,50 @@
1
- # ILO Design System - Styles Package
1
+ # ILO Design System - Styles
2
2
 
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:
3
+ The Styles package provides the stylesheets which are used to style the components in other packages. It includes both the styles for the individual components as well as bundled stylesheets for the entire design system. Both scss and compiled css files are exported from the package.
4
4
 
5
- - [@ilo-org/themes](./packages/themes)
6
- - [@ilo-org/fonts](./packages/fonts)
7
- - [@ilo-org/icons](./packages/icons)
5
+ The styles are written in [SCSS](https://sass-lang.com/), so you can also import the SCSS files and include them in your own SASS workflow.
8
6
 
9
- ## Installation and commands
10
-
11
- To install
7
+ ## Installation
12
8
 
13
9
  ```bash
14
10
  npm i @ilo-org/styles
15
11
  ```
16
12
 
17
- To build
13
+ ## Usage
18
14
 
19
- ```bash
20
- pnpm build
21
- ```
15
+ ### Include the bundled stylesheet
22
16
 
23
- To minify
17
+ If you're going to use all or most of the components in the Design System, the easiest thing to do is to include the bundled stylesheet, which includes all of the styles for all of the components.
24
18
 
25
- ```bash
26
- pnpm minify
27
- ```
19
+ To do this, you can copy the file `@ilo-org/styles/css/index.css` to a place where you're hosting static files via build command and include it from there.
28
20
 
29
- To test formatting
21
+ You can also import compiled CSS files for the individual components, which can be fetched or included from `@ilo-org/styles/css/components` directory.
30
22
 
31
- ```bash
32
- pnpm format
33
- ```
23
+ Here's an example which uses Webpack to output CSS files together with components from the Design System's [React package](../react).
34
24
 
35
- To test formatting and fix errors
25
+ ```jsx
26
+ import React from "react";
27
+ import { Accordion } from "@ilo-org/react";
28
+ import "@ilo-org/styles/css/components/accordion";
36
29
 
37
- ```bash
38
- pnpm format:fix
30
+ const MyAccordion = (props) => {
31
+ return <Accordion {...props}>
32
+ }
39
33
  ```
40
34
 
41
- To lint
35
+ ### Use the source files directly
42
36
 
43
- ```bash
44
- pnpm lint
45
- ```
37
+ If you're already using SASS, then you can also import the SCSS files directly into your project and include them into your own SASS bundle.
46
38
 
47
- To test formatting and fix errors
39
+ Note that if you're doing this, you will also need to import the `@ilo-org/themes` package to ensure the SASS files have access to the style tokens they need.
48
40
 
49
- ```bash
50
- pnpm lint:fix
41
+ ```SCSS
42
+ @import "@ilo-org/themes/build/scss/tokens";
43
+ @import "@ilo-org/styles/scss";
51
44
  ```
52
45
 
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
79
-
80
- ### Versioning
81
-
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.
83
-
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).
93
-
94
- ```
95
- <type>(<scope>): <subject>
96
- ```
97
-
98
- Examples:
99
-
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
108
-
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
46
+ As above, if you don't need styles for the whole design system, you can also import SCSS files from individual components.
124
47
 
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
48
+ ```SCSS
49
+ @import "@ilo-org/styles/scss/components/accordion";
186
50
  ```