Skip to content

Commit 221ac67

Browse files
authored
Fix/remove fonts (#30)
* Removed inter fonts * Made font names lowercase * Changed variables to default, added iconpath variable * Moved copying fonts to gulp
1 parent 308ebb7 commit 221ac67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2983
-4383
lines changed

gulpfile.js

+26-8
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,41 @@ const gulp = require('gulp');
44
const sass = require('gulp-sass');
55
sass.compiler = require('sass');
66
const rename = require('gulp-rename');
7-
const ts = require('gulp-typescript');
87

9-
const buildSass = async () => {
8+
const buildCss = async () => {
109
return await gulp.src('./src/style/index.scss')
1110
.pipe(sass().on('error', sass.logError))
12-
.pipe(gulp.dest('./dist/style'));
11+
.pipe(gulp.dest('./dist/css'));
1312
}
1413

15-
gulp.task('sass', buildSass);
14+
gulp.task('css:build', buildCss);
1615

17-
const buildSassMin = async () => {
16+
const copySass = async () => {
17+
return await gulp.src('./src/style/**/*.scss')
18+
.pipe(gulp.dest('./dist/scss'))
19+
}
20+
21+
gulp.task('sass:copy', copySass);
22+
23+
const buildCssMin = async () => {
1824
return await gulp.src('./src/style/index.scss')
1925
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
2026
.pipe(rename('index.min.css'))
21-
.pipe(gulp.dest('./dist/style'));
27+
.pipe(gulp.dest('./dist/css'));
28+
}
29+
30+
gulp.task('css:build:min', buildCssMin);
31+
32+
const copyIcons = async () => {
33+
return await gulp.src('./src/icons/*')
34+
.pipe(gulp.dest('./dist/icons'))
2235
}
2336

24-
gulp.task('sass:min', buildSassMin);
37+
gulp.task('icons:copy', copyIcons);
2538

26-
gulp.task('default', gulp.series('sass', 'sass:min'));
39+
gulp.task('default', gulp.series(
40+
'css:build',
41+
'css:build:min',
42+
'sass:copy',
43+
'icons:copy'
44+
));

package-lock.json

+2,893-1,072
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+16-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "dist/index.d.ts",
77
"typings": "dist/index.d.ts",
88
"scripts": {
9-
"build:css": "rimraf scss && cp -r ./src/style scss && gulp",
9+
"build:css": "gulp",
1010
"build:js": "tsc -p tsconfig-build.json",
1111
"build": "rimraf dist && npm run build:js && npm run build:css",
1212
"test": "jest --config=jest.config.json",
@@ -17,23 +17,23 @@
1717
"license": "ISC",
1818
"repository": "https://github.com/coderan-io/ui",
1919
"devDependencies": {
20-
"@babel/plugin-proposal-class-properties": "^7.10.4",
21-
"@babel/preset-env": "^7.11.0",
22-
"@babel/preset-react": "^7.10.4",
23-
"@babel/preset-typescript": "^7.10.4",
20+
"@babel/plugin-proposal-class-properties": "^7.13.0",
21+
"@babel/preset-env": "^7.13.8",
22+
"@babel/preset-react": "^7.12.13",
23+
"@babel/preset-typescript": "^7.13.0",
2424
"@types/enzyme": "^3.10.8",
2525
"@types/enzyme-adapter-react-16": "^1.0.6",
26-
"@types/react": "^16.9.55",
27-
"@types/react-dom": "^16.9.9",
28-
"@typescript-eslint/eslint-plugin": "^4.6.1",
29-
"@typescript-eslint/parser": "^4.6.1",
26+
"@types/react": "^16.14.4",
27+
"@types/react-dom": "^16.9.11",
28+
"@typescript-eslint/eslint-plugin": "^4.15.2",
29+
"@typescript-eslint/parser": "^4.15.2",
3030
"babel-loader": "^8.2.2",
3131
"css-loader": "^5.1.0",
3232
"dotenv": "^8.2.0",
3333
"enzyme": "^3.11.0",
34-
"enzyme-adapter-react-16": "^1.15.3",
35-
"eslint": "^7.12.1",
36-
"eslint-plugin-react": "^7.20.6",
34+
"enzyme-adapter-react-16": "^1.15.6",
35+
"eslint": "^7.21.0",
36+
"eslint-plugin-react": "^7.22.0",
3737
"file-loader": "^6.2.0",
3838
"gulp": "^4.0.2",
3939
"gulp-rename": "^2.0.0",
@@ -46,16 +46,17 @@
4646
"sass": "^1.32.8",
4747
"sass-loader": "^11.0.1",
4848
"style-loader": "^2.0.0",
49-
"typescript": "^4.0.5",
49+
"typescript": "^4.2.2",
5050
"webpack": "^5.24.2",
5151
"webpack-cli": "^4.5.0",
5252
"webpack-dev-server": "^3.11.2",
5353
"webpack-manifest-plugin": "^3.0.0"
5454
},
5555
"dependencies": {
56-
"@popperjs/core": "^2.6.0",
56+
"@popperjs/core": "^2.8.6",
57+
"bootstrap": "^4.6.0",
5758
"clsx": "^1.1.1",
58-
"framer-motion": "^3.1.1",
59+
"framer-motion": "^3.7.0",
5960
"prop-types": "^15.7.2",
6061
"react": "^16.14.0"
6162
},

src/fonts/inter/inter-v2-latin-100.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-100.svg

-349
This file was deleted.
-44.6 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-100.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-100.woff2

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-200.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-200.svg

-350
This file was deleted.
-44.6 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-200.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-200.woff2

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-300.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-300.svg

-350
This file was deleted.
-44.6 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-300.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-300.woff2

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-500.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-500.svg

-351
This file was deleted.
-44.8 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-500.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-500.woff2

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-600.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-600.svg

-351
This file was deleted.
-45 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-600.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-600.woff2

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-700.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-700.svg

-352
This file was deleted.
-45 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-700.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-700.woff2

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-800.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-800.svg

-350
This file was deleted.
-45.1 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-800.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-800.woff2

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-900.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-900.svg

-349
This file was deleted.
-45.1 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-900.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-900.woff2

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-regular.eot

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-regular.svg

-351
This file was deleted.
-44.6 KB
Binary file not shown.

src/fonts/inter/inter-v2-latin-regular.woff

Whitespace-only changes.

src/fonts/inter/inter-v2-latin-regular.woff2

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/style/base/_base.scss

-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@ body {
77
background: var(--base-body-background);
88
color: var(--base-font-color);
99
margin: var(--base-body-gutter);
10-
font: {
11-
family: var(--base-font-family);
12-
}
1310
line-height: 1.2rem;
1411
}

src/style/base/_typography.scss

+4-88
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,15 @@
11
@use "mixins";
22
@use "variables";
33

4-
/* inter-100 - latin */
5-
@font-face {
6-
font-family: 'Inter';
7-
font-style: normal;
8-
font-weight: 100;
9-
src: local(''),
10-
url('../fonts/inter/inter-v2-latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
11-
url('../fonts/inter/inter-v2-latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
12-
}
13-
/* inter-200 - latin */
14-
@font-face {
15-
font-family: 'Inter';
16-
font-style: normal;
17-
font-weight: 200;
18-
src: local(''),
19-
url('../fonts/inter/inter-v2-latin-200.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
20-
url('../fonts/inter/inter-v2-latin-200.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
21-
}
22-
/* inter-300 - latin */
23-
@font-face {
24-
font-family: 'Inter';
25-
font-style: normal;
26-
font-weight: 300;
27-
src: local(''),
28-
url('../fonts/inter/inter-v2-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
29-
url('../fonts/inter/inter-v2-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
30-
}
31-
/* inter-regular - latin */
32-
@font-face {
33-
font-family: 'Inter';
34-
font-style: normal;
35-
font-weight: 400;
36-
src: local(''),
37-
url('../fonts/inter/inter-v2-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
38-
url('../fonts/inter/inter-v2-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
39-
}
40-
/* inter-500 - latin */
41-
@font-face {
42-
font-family: 'Inter';
43-
font-style: normal;
44-
font-weight: 500;
45-
src: local(''),
46-
url('../fonts/inter/inter-v2-latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
47-
url('../fonts/inter/inter-v2-latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
48-
}
49-
/* inter-600 - latin */
50-
@font-face {
51-
font-family: 'Inter';
52-
font-style: normal;
53-
font-weight: 600;
54-
src: local(''),
55-
url('../fonts/inter/inter-v2-latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
56-
url('../fonts/inter/inter-v2-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
57-
}
58-
/* inter-700 - latin */
59-
@font-face {
60-
font-family: 'Inter';
61-
font-style: normal;
62-
font-weight: 700;
63-
src: local(''),
64-
url('../fonts/inter/inter-v2-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
65-
url('../fonts/inter/inter-v2-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
66-
}
67-
/* inter-800 - latin */
68-
@font-face {
69-
font-family: 'Inter';
70-
font-style: normal;
71-
font-weight: 800;
72-
src: local(''),
73-
url('../fonts/inter/inter-v2-latin-800.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
74-
url('../fonts/inter/inter-v2-latin-800.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
75-
}
76-
/* inter-900 - latin */
77-
@font-face {
78-
font-family: 'Inter';
79-
font-style: normal;
80-
font-weight: 900;
81-
src: local(''),
82-
url('../fonts/inter/inter-v2-latin-900.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
83-
url('../fonts/inter/inter-v2-latin-900.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
84-
}
85-
86-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');
87-
884
@font-face {
895
font-family: 'Cui-Icons';
906
font-style: normal;
917
font-weight: 500;
928
src: local(''),
93-
url('../fonts/icons/cui-icons.eot') format('eot'),
94-
url('../fonts/icons/cui-icons.svg') format('svg'),
95-
url('../fonts/icons/cui-icons.ttf') format('ttf'),
96-
url('../fonts/icons/cui-icons.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
9+
url('#{variables.$iconPath}/cui-icons.eot') format('eot'),
10+
url('#{variables.$iconPath}/cui-icons.svg') format('svg'),
11+
url('#{variables.$iconPath}/cui-icons.ttf') format('ttf'),
12+
url('#{variables.$iconPath}/cui-icons.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
9713
}
9814

9915
h1 {

src/style/base/_variables.scss

+43-44
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ $colors: (
140140
'dark': hsl(200, 19%, 18%),
141141
'default-font-color': #fff, //AAA
142142
)
143-
);
143+
) !default;
144144

145145
@function color($color, $variant: 'default') {
146146
@return map-get(map-get($colors, $color), $variant);
@@ -149,47 +149,45 @@ $colors: (
149149
/**
150150
* 2. Base
151151
*/
152-
$base-background-color: color('gray', 'background');
153-
$base-body-gutter: 0;
154-
$base-font-color: hsl(200, 19%, 18%);
155-
$base-font-family: 'Inter, apple-sf-pro-text, Helvetica, Arial, sans-serif';
156-
$base-border-color: hsl(0, 0%, 88%);
157-
$base-border-hover-color: hsl(0, 0%, 74%);
158-
$base-border-radius: 4px;
159-
$base-gutter: 1rem;
160-
$base-gutter-steps: 0.25;
152+
$base-background-color: color('gray', 'background') !default;
153+
$base-body-gutter: 0 !default;
154+
$base-font-color: hsl(200, 19%, 18%) !default;
155+
$base-border-color: hsl(0, 0%, 88%) !default;
156+
$base-border-hover-color: hsl(0, 0%, 74%) !default;
157+
$base-border-radius: 4px !default;
158+
$base-gutter: 1rem !default;
159+
$base-gutter-steps: 0.25 !default;
161160

162161
$breakpoints: (
163162
'sm': '640px',
164163
'md': '768px',
165164
'lg': '1024px',
166165
'xl': '1280px'
167-
);
166+
) !default;
168167

169168
:root {
170169
--base-body-background: #{$base-background-color};
171170
--base-body-gutter: #{$base-body-gutter};
172171
--base-font-color: #{$base-font-color};
173-
--base-font-family: #{$base-font-family};
174172
--base-border-color: #{$base-border-color};
175173
--base-border-hover-color: #{$base-border-hover-color};
176174
--base-border-radius: #{$base-border-radius};
177175
--base-gutter: #{$base-gutter};
178176
}
179177

180-
$primary-color: color('deep-purple', 'default');
181-
$primary-color-hover: color('deep-purple', 'hover');
182-
$primary-color-active: color('deep-purple', 'active');
183-
$primary-color-light-background: color('deep-purple', 'background');
178+
$primary-color: color('deep-purple', 'default') !default;
179+
$primary-color-hover: color('deep-purple', 'hover') !default;
180+
$primary-color-active: color('deep-purple', 'active') !default;
181+
$primary-color-light-background: color('deep-purple', 'background') !default;
184182

185-
$danger-color: color('red', 'default');
186-
$danger-color-hover: color('red', 'hover');
187-
$danger-color-active: color('red', 'active');
188-
$danger-color-light-background: color('red', 'background');
183+
$danger-color: color('red', 'default') !default;
184+
$danger-color-hover: color('red', 'hover') !default;
185+
$danger-color-active: color('red', 'active') !default;
186+
$danger-color-light-background: color('red', 'background') !default;
189187

190-
$success-color: color('green', 'default');
191-
$success-color-hover: color('green', 'hover');
192-
$success-color-active: color('green', 'active');
188+
$success-color: color('green', 'default') !default;
189+
$success-color-hover: color('green', 'hover') !default;
190+
$success-color-active: color('green', 'active') !default;
193191

194192
:root {
195193
--primary-color: #{$primary-color};
@@ -210,8 +208,8 @@ $success-color-active: color('green', 'active');
210208
/**
211209
* 3. Panel
212210
*/
213-
$panel-background: #fff;
214-
$panel-gutter: 2rem;
211+
$panel-background: #fff !default;
212+
$panel-gutter: 2rem !default;
215213

216214
:root {
217215
--panel-background: #{$panel-background};
@@ -221,7 +219,7 @@ $panel-gutter: 2rem;
221219
/**
222220
* 4. Page
223221
*/
224-
$page-gutter: 2rem;
222+
$page-gutter: 2rem !default;
225223

226224
:root {
227225
--page-gutter: #{$page-gutter};
@@ -230,19 +228,19 @@ $page-gutter: 2rem;
230228
/**
231229
* 5. Button
232230
*/
233-
$button-padding: 1rem;
234-
$button-font-weight: 600;
235-
$button-font-size: 1rem;
231+
$button-padding: 1rem !default;
232+
$button-font-weight: 600 !default;
233+
$button-font-size: 1rem !default;
236234

237-
$primary-button-ghost-hover-background: color('deep-purple', 'background');
238-
$primary-button-ghost-active-background: color('deep-purple', 'background-hover');
235+
$primary-button-ghost-hover-background: color('deep-purple', 'background') !default;
236+
$primary-button-ghost-active-background: color('deep-purple', 'background-hover') !default;
239237

240-
$secondary-button-background: transparent;
241-
$secondary-button-hover-background: color('deep-purple', 'background');
242-
$secondary-button-active-background: color('deep-purple', 'background-hover');
238+
$secondary-button-background: transparent !default;
239+
$secondary-button-hover-background: color('deep-purple', 'background') !default;
240+
$secondary-button-active-background: color('deep-purple', 'background-hover') !default;
243241

244-
$danger-button-ghost-hover-background: color('red', 'background');
245-
$danger-button-ghost-active-background: color('red', 'background-hover');
242+
$danger-button-ghost-hover-background: color('red', 'background') !default;
243+
$danger-button-ghost-active-background: color('red', 'background-hover') !default;
246244

247245
:root {
248246
--button-padding: #{$button-padding};
@@ -281,8 +279,8 @@ $danger-button-ghost-active-background: color('red', 'background-hover');
281279
/**
282280
* 6. Cards
283281
*/
284-
$card-padding: 1.5rem;
285-
$card-background: #fff;
282+
$card-padding: 1.5rem !default;
283+
$card-background: #fff !default;
286284

287285
:root {
288286
--card-padding: #{$card-padding};
@@ -292,9 +290,9 @@ $card-background: #fff;
292290
/**
293291
* 7. Form fields
294292
*/
295-
$form-field-padding: 1rem;
296-
$form-field-font-weight: 500;
297-
$form-field-font-size: 1rem;
293+
$form-field-padding: 1rem !default;
294+
$form-field-font-weight: 500 !default;
295+
$form-field-font-size: 1rem !default;
298296

299297
:root {
300298
--form-field-padding: #{$form-field-padding};
@@ -305,6 +303,7 @@ $form-field-font-size: 1rem;
305303
/**
306304
* 8. Icons
307305
*/
306+
$iconPath: '../icons' !default;
308307
$icons: (
309308
'activity': '\e900',
310309
'alert-circle': '\e901',
@@ -559,9 +558,9 @@ $icons: (
559558
/**
560559
* 8. Form fields
561560
*/
562-
$form-field-padding: 1rem;
563-
$form-field-font-weight: 500;
564-
$form-field-font-size: 1rem;
561+
$form-field-padding: 1rem !default;
562+
$form-field-font-weight: 500 !default;
563+
$form-field-font-size: 1rem !default;
565564

566565
:root {
567566
--form-field-padding: #{$form-field-padding};

0 commit comments

Comments
 (0)