@san-siva/stylekit 1.0.2 → 1.0.3
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 +171 -132
- package/package.json +1 -8
- package/styles/typography.module.scss +2 -0
package/README.md
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# StyleKit
|
|
2
2
|
|
|
3
|
-
A comprehensive SCSS
|
|
3
|
+
A comprehensive, modular SCSS design system providing colors, typography, animations, utilities, and layout dimensions for building consistent, beautiful user interfaces. Built with CSS Modules support and designed for modern web applications.
|
|
4
|
+
|
|
5
|
+
**[View Full Documentation](https://stylekit-68309.web.app/)**
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
StyleKit is a production-ready SCSS design system that provides a complete set of design tokens, utility functions, and pre-built styles for rapid UI development. It ensures style consistency across your application while maintaining flexibility for customization. Built with modern SCSS features, it works seamlessly with any framework or build tool that supports SCSS and CSS Modules.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Comprehensive Color System**: Primary, secondary, accent, semantic, and grayscale colors with variants
|
|
14
|
+
- **Typography Scale**: Font families, sizes, weights, line heights, and utility classes
|
|
15
|
+
- **Spacing System**: 0-9 scale with utility functions and classes for margins and padding
|
|
16
|
+
- **Layout System**: Responsive containers, page layouts, and dimension utilities
|
|
17
|
+
- **Animation Library**: Pre-built keyframe animations for common UI patterns
|
|
18
|
+
- **Utility Functions**: rem/em converters, spacing functions, and helper utilities
|
|
19
|
+
- **CSS Modules Ready**: Full support for scoped styling with CSS Modules
|
|
20
|
+
- **Framework Agnostic**: Works with React, Vue, Angular, Next.js, and more
|
|
21
|
+
- **TypeScript Friendly**: Designed for modern tooling and development workflows
|
|
22
|
+
- **Responsive Design**: Built-in breakpoints and responsive utilities
|
|
4
23
|
|
|
5
24
|
## Installation
|
|
6
25
|
|
|
@@ -12,197 +31,217 @@ yarn add @san-siva/stylekit
|
|
|
12
31
|
pnpm add @san-siva/stylekit
|
|
13
32
|
```
|
|
14
33
|
|
|
15
|
-
|
|
34
|
+
### Requirements
|
|
16
35
|
|
|
17
|
-
|
|
36
|
+
- Sass >= 1.50.0
|
|
37
|
+
- CSS Modules support in your build tool
|
|
38
|
+
- Any modern framework (React, Vue, Angular, etc.) or vanilla JavaScript
|
|
18
39
|
|
|
19
|
-
|
|
20
|
-
@use '@san-siva/stylekit' as styles;
|
|
40
|
+
## Quick Start
|
|
21
41
|
|
|
22
|
-
.
|
|
23
|
-
color: styles.$color--primary;
|
|
24
|
-
font-size: styles.$font-size--h1;
|
|
25
|
-
}
|
|
26
|
-
```
|
|
42
|
+
### 1. Import Global Styles (Optional)
|
|
27
43
|
|
|
28
|
-
|
|
44
|
+
Import the global stylesheet in your application entry point for base styles and resets:
|
|
29
45
|
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@use '@san-siva/stylekit/utils' as utils;
|
|
34
|
-
|
|
35
|
-
.my-element {
|
|
36
|
-
color: colors.$color--primary;
|
|
37
|
-
font-size: typography.$font-size--h1;
|
|
38
|
-
padding: utils.space(3);
|
|
39
|
-
}
|
|
46
|
+
```tsx
|
|
47
|
+
// app/layout.tsx or _app.tsx
|
|
48
|
+
import '@san-siva/stylekit/styles/globals.scss';
|
|
40
49
|
```
|
|
41
50
|
|
|
42
|
-
|
|
51
|
+
### 2. Import SCSS Modules
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
Import StyleKit modules in your component styles:
|
|
45
54
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
55
|
+
```scss
|
|
56
|
+
// components/Button.module.scss
|
|
57
|
+
@use '@san-siva/stylekit/styles/colors.module.scss' as colors;
|
|
58
|
+
@use '@san-siva/stylekit/styles/utils.module.scss' as utils;
|
|
59
|
+
|
|
60
|
+
.button {
|
|
61
|
+
background-color: colors.$color--primary;
|
|
62
|
+
padding: utils.space(2);
|
|
63
|
+
border-radius: utils.rem(8);
|
|
64
|
+
|
|
65
|
+
&:hover {
|
|
66
|
+
background-color: colors.$color--primary-light;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
56
70
|
|
|
57
|
-
|
|
58
|
-
- `$color--base`: #ffffff
|
|
59
|
-
- `$color--surface`: #f6f6f6
|
|
60
|
-
- `$color--dark`: #313030
|
|
61
|
-
- `$color--black`: #000
|
|
71
|
+
### 3. Use Utility Classes
|
|
62
72
|
|
|
63
|
-
|
|
64
|
-
- `$color--grey-light` through `$color--grey-darker`
|
|
73
|
+
Import utility classes in your components:
|
|
65
74
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- `$color--link`: #0d6efd
|
|
69
|
-
- `$color--pink`: #e60067
|
|
70
|
-
- `$color--glass`: rgba(255, 255, 255, 0.85)
|
|
75
|
+
```tsx
|
|
76
|
+
import styles from '@san-siva/stylekit/styles/index.module.scss';
|
|
71
77
|
|
|
72
|
-
|
|
78
|
+
export function MyComponent() {
|
|
79
|
+
return (
|
|
80
|
+
<div className={styles['margin-bottom--3']}>
|
|
81
|
+
<h1 className={styles['font-size--h1']}>Welcome</h1>
|
|
82
|
+
<p className={styles['margin-top--2']}>Get started with StyleKit!</p>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
73
87
|
|
|
74
|
-
|
|
88
|
+
## Documentation
|
|
75
89
|
|
|
76
|
-
|
|
77
|
-
- `$font-family--primary`: 'Rubik', sans-serif
|
|
78
|
-
- `$font-family--secondary`: 'Montserrat', sans-serif
|
|
79
|
-
- `$font-family--code`: 'JetBrains Mono', monospace
|
|
90
|
+
Comprehensive documentation is available at [https://stylekit-68309.web.app/](https://stylekit-68309.web.app/)
|
|
80
91
|
|
|
81
|
-
|
|
82
|
-
- `$font-size--h1` through `$font-size--h6`
|
|
83
|
-
- `$font-size--big`, `$font-size--p`, `$font-size--small`
|
|
84
|
-
- `$font-size--button`, `$font-size--very-small`
|
|
92
|
+
The documentation includes:
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
-
|
|
94
|
+
- Complete module reference with all variables and utilities
|
|
95
|
+
- Visual examples and color swatches
|
|
96
|
+
- Code examples for every feature
|
|
97
|
+
- Best practices and usage patterns
|
|
98
|
+
- Framework integration guides (React, Vue, Angular)
|
|
99
|
+
- Customization and theming guide
|
|
100
|
+
- Performance optimization tips
|
|
88
101
|
|
|
89
|
-
|
|
90
|
-
- `$line-height--large`: 1.9
|
|
91
|
-
- `$line-height--normal`: 1.6
|
|
92
|
-
- `$line-height--small`: 1.4
|
|
102
|
+
## Module Overview
|
|
93
103
|
|
|
94
|
-
|
|
95
|
-
- `.font--primary`, `.font--secondary`, `.font--code`
|
|
96
|
-
- `.font-weight--400` through `.font-weight--800`
|
|
97
|
-
- `.font-size--h1` through `.font-size--small`
|
|
98
|
-
- `.line-height--large`, `.line-height--normal`, `.line-height--small`
|
|
99
|
-
- `.category__header` - Pink uppercase header style
|
|
100
|
-
- `.a--highlighted` - Underlined link style
|
|
104
|
+
### Colors Module
|
|
101
105
|
|
|
102
|
-
|
|
106
|
+
Comprehensive color palette with semantic naming:
|
|
107
|
+
- **Primary Colors**: Main brand colors with light variants
|
|
108
|
+
- **Accent Colors**: Highlight and emphasis colors
|
|
109
|
+
- **Secondary Colors**: Supporting brand colors
|
|
110
|
+
- **Semantic Colors**: Error, success, warning states
|
|
111
|
+
- **Greyscale**: Light through dark grey tones
|
|
112
|
+
- **Base Colors**: Background and surface colors
|
|
103
113
|
|
|
104
|
-
|
|
114
|
+
```scss
|
|
115
|
+
@use '@san-siva/stylekit/styles/colors.module.scss' as colors;
|
|
105
116
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
|
|
117
|
+
.alert {
|
|
118
|
+
background: colors.$color--error-light;
|
|
119
|
+
border-left: 3px solid colors.$color--error;
|
|
120
|
+
}
|
|
121
|
+
```
|
|
110
122
|
|
|
111
|
-
|
|
112
|
-
- 0: 4px, 1: 8px, 2: 16px, 3: 24px, 4: 32px
|
|
113
|
-
- 5: 40px, 6: 48px, 7: 56px, 8: 64px, 9: 96px
|
|
123
|
+
### Typography Module
|
|
114
124
|
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
125
|
+
Complete typographic system with:
|
|
126
|
+
- **Font Families**: Rubik, Montserrat, JetBrains Mono
|
|
127
|
+
- **Font Sizes**: h1-h6, paragraph, small (with utility classes)
|
|
128
|
+
- **Font Weights**: 400-800 (with utility classes)
|
|
129
|
+
- **Line Heights**: Large, normal, small
|
|
120
130
|
|
|
121
|
-
Example:
|
|
122
131
|
```scss
|
|
123
|
-
@use '@san-siva/stylekit/
|
|
132
|
+
@use '@san-siva/stylekit/styles/typography.module.scss' as type;
|
|
124
133
|
|
|
125
|
-
.
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
.heading {
|
|
135
|
+
font-family: type.$font-family--secondary;
|
|
136
|
+
font-size: type.$font-size--h2;
|
|
137
|
+
font-weight: type.$font-weight--700;
|
|
128
138
|
}
|
|
129
139
|
```
|
|
130
140
|
|
|
131
|
-
###
|
|
141
|
+
### Utils Module
|
|
132
142
|
|
|
133
|
-
|
|
143
|
+
Utility functions and spacing system:
|
|
144
|
+
- **Functions**: `rem()`, `em()`, `space()` converters
|
|
145
|
+
- **Spacing Scale**: 0-9 (4px to 96px)
|
|
146
|
+
- **Margin/Padding Classes**: All directions with scale support
|
|
134
147
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- `.container--contents-centered` - Centered content
|
|
138
|
-
- `.container--no-padding` - Remove padding
|
|
148
|
+
```scss
|
|
149
|
+
@use '@san-siva/stylekit/styles/utils.module.scss' as utils;
|
|
139
150
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
|
|
151
|
+
.card {
|
|
152
|
+
padding: utils.space(3); // 24px
|
|
153
|
+
margin-bottom: utils.space(4); // 32px
|
|
154
|
+
border-radius: utils.rem(8); // 0.5rem
|
|
155
|
+
}
|
|
156
|
+
```
|
|
145
157
|
|
|
146
|
-
|
|
147
|
-
- `$border-radius`: 4px through `$border-radius--4`: 32px
|
|
158
|
+
### Dimensions Module
|
|
148
159
|
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
160
|
+
Layout and responsive utilities:
|
|
161
|
+
- **Containers**: Flexible container classes
|
|
162
|
+
- **Page Layout**: Max-width page containers
|
|
163
|
+
- **Border Radius**: Scale from 4px to 32px
|
|
164
|
+
- **Breakpoints**: Mobile, tablet, and desktop
|
|
153
165
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
- `.li--disabled` - Disabled list item
|
|
157
|
-
- `.block` - Display block
|
|
166
|
+
```scss
|
|
167
|
+
@use '@san-siva/stylekit/styles/dimensions.module.scss' as dims;
|
|
158
168
|
|
|
159
|
-
|
|
169
|
+
.card {
|
|
170
|
+
border-radius: dims.$border-radius--2;
|
|
171
|
+
}
|
|
172
|
+
```
|
|
160
173
|
|
|
161
|
-
|
|
174
|
+
### Animations Module
|
|
162
175
|
|
|
163
|
-
|
|
176
|
+
Pre-built keyframe animations:
|
|
164
177
|
- `loading_animation` - Background position animation
|
|
165
178
|
- `MoveInTop` - Slide in from bottom
|
|
166
179
|
- `fadeInDown` - Fade in from top
|
|
167
|
-
- `fadeUp` - Fade up
|
|
180
|
+
- `fadeUp` - Fade up with offset
|
|
168
181
|
|
|
169
|
-
Example:
|
|
170
182
|
```scss
|
|
171
|
-
@use '@san-siva/stylekit/animations';
|
|
183
|
+
@use '@san-siva/stylekit/styles/animations.module.scss';
|
|
172
184
|
|
|
173
|
-
.
|
|
174
|
-
animation:
|
|
185
|
+
.modal {
|
|
186
|
+
animation: MoveInTop 0.3s ease-out;
|
|
175
187
|
}
|
|
176
188
|
```
|
|
177
189
|
|
|
178
|
-
|
|
190
|
+
## Package Exports
|
|
179
191
|
|
|
180
|
-
|
|
192
|
+
The package provides multiple entry points for flexible imports:
|
|
181
193
|
|
|
182
|
-
```
|
|
183
|
-
@
|
|
194
|
+
```
|
|
195
|
+
@san-siva/stylekit/styles/index.module.scss - All modules
|
|
196
|
+
@san-siva/stylekit/styles/colors.module.scss - Colors only
|
|
197
|
+
@san-siva/stylekit/styles/typography.module.scss - Typography only
|
|
198
|
+
@san-siva/stylekit/styles/utils.module.scss - Utils only
|
|
199
|
+
@san-siva/stylekit/styles/dimensions.module.scss - Dimensions only
|
|
200
|
+
@san-siva/stylekit/styles/animations.module.scss - Animations only
|
|
201
|
+
@san-siva/stylekit/styles/globals.scss - Global styles
|
|
184
202
|
```
|
|
185
203
|
|
|
186
|
-
##
|
|
204
|
+
## Examples
|
|
187
205
|
|
|
188
|
-
|
|
206
|
+
StyleKit is used in production on these sites:
|
|
189
207
|
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
- `@san-siva/stylekit/dimensions` - Dimensions only
|
|
195
|
-
- `@san-siva/stylekit/animations` - Animations only
|
|
196
|
-
- `@san-siva/stylekit/globals` - Global styles
|
|
208
|
+
- **[StyleKit Documentation](https://stylekit-68309.web.app/)** - Interactive documentation site
|
|
209
|
+
- **[Blogkit Documentation](https://blogkit-c367c.web.app/)** - Component library docs
|
|
210
|
+
- **[Gitsy](https://gitsy-56895.web.app/)** - Blog application
|
|
211
|
+
- **[Personal Portfolio](https://santhoshsiva.dev)** - Developer portfolio
|
|
197
212
|
|
|
198
213
|
## Works Great With
|
|
199
214
|
|
|
200
|
-
|
|
215
|
+
StyleKit is designed to work seamlessly with [@san-siva/blogkit](https://www.npmjs.com/package/@san-siva/blogkit) for building beautiful blog interfaces with consistent styling.
|
|
216
|
+
|
|
217
|
+
## Browser Support
|
|
218
|
+
|
|
219
|
+
StyleKit supports all modern browsers:
|
|
220
|
+
- Chrome (latest)
|
|
221
|
+
- Firefox (latest)
|
|
222
|
+
- Safari (latest)
|
|
223
|
+
- Edge (latest)
|
|
201
224
|
|
|
202
225
|
## Contributing
|
|
203
226
|
|
|
204
|
-
Contributions are welcome
|
|
227
|
+
Contributions are welcome and appreciated. To contribute:
|
|
228
|
+
|
|
229
|
+
1. Fork the repository
|
|
230
|
+
2. Create a feature branch (`git checkout -b feature/improvement`)
|
|
231
|
+
3. Commit your changes (`git commit -am 'Add new feature'`)
|
|
232
|
+
4. Push to the branch (`git push origin feature/improvement`)
|
|
233
|
+
5. Open a Pull Request
|
|
234
|
+
|
|
235
|
+
Please ensure your code follows the existing style conventions.
|
|
236
|
+
|
|
237
|
+
For bug reports and feature requests, please [open an issue](https://github.com/san-siva/stylekit/issues) on GitHub.
|
|
205
238
|
|
|
206
239
|
## License
|
|
207
240
|
|
|
208
241
|
MIT © [Santhosh Siva](https://santhoshsiva.dev)
|
|
242
|
+
|
|
243
|
+
## Author
|
|
244
|
+
|
|
245
|
+
**Santhosh Siva**
|
|
246
|
+
- Website: [https://santhoshsiva.dev](https://santhoshsiva.dev)
|
|
247
|
+
- GitHub: [@san-siva](https://github.com/san-siva)
|
package/package.json
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@san-siva/stylekit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A modular SCSS design system with utilities, colors, typography, and animations",
|
|
5
5
|
"main": "styles/index.module.scss",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./styles/index.module.scss",
|
|
8
|
-
"./index.module.scss": "./styles/index.module.scss",
|
|
9
|
-
"./animations.module.scss": "./styles/animations.module.scss",
|
|
10
|
-
"./colors.module.scss": "./styles/colors.module.scss",
|
|
11
|
-
"./dimensions.module.scss": "./styles/dimensions.module.scss",
|
|
12
|
-
"./typography.module.scss": "./styles/typography.module.scss",
|
|
13
|
-
"./utils.module.scss": "./styles/utils.module.scss",
|
|
14
|
-
"./globals.scss": "./styles/globals.scss",
|
|
15
8
|
"./styles/*.scss": "./styles/*.scss",
|
|
16
9
|
"./styles/index.module.scss": "./styles/index.module.scss",
|
|
17
10
|
"./styles/animations.module.scss": "./styles/animations.module.scss",
|
|
@@ -31,6 +31,7 @@ $font-size: $font-size--p;
|
|
|
31
31
|
$line-height--large: 1.9;
|
|
32
32
|
$line-height--normal: 1.6;
|
|
33
33
|
$line-height--small: 1.4;
|
|
34
|
+
$line-height--very-small: 1.2;
|
|
34
35
|
|
|
35
36
|
$font-families: (
|
|
36
37
|
primary: $font-family--primary,
|
|
@@ -63,6 +64,7 @@ $line-heights: (
|
|
|
63
64
|
large: $line-height--large,
|
|
64
65
|
normal: $line-height--normal,
|
|
65
66
|
small: $line-height--small,
|
|
67
|
+
very-small: $line-height--very-small,
|
|
66
68
|
);
|
|
67
69
|
|
|
68
70
|
@each $name, $value in $font-families {
|