Skip to content

Commit 4a9ae5e

Browse files
Remove css compilation from rollup (js) configuration.
1 parent 8f2e8df commit 4a9ae5e

File tree

9 files changed

+239
-3637
lines changed

9 files changed

+239
-3637
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
node_modules
3-
.idea
3+
.idea
4+
yarn.lock

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ new Choosy(document.getElementById("cars_limited_2"), {
8484

8585
Since Choosy is an open-source project you are very welcome to contribute by sending a PR.
8686

87+
## Compiling
88+
To apply the latest changes and compile it to a ready-to-go package into the `dist` folder you can use the following commands:
89+
90+
```shell
91+
postcss ./src/style/choosy.css -o ./dist/choosy.min.css
92+
rollup -c
93+
```
94+
8795
## Testing
8896

8997
Choosy uses [Cypress](https://www.cypress.io/) for testing.

dist/choosy.min.css

Lines changed: 212 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,212 @@
1-
button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.choosy-widget{align-items:center;border-color:#e5e7eb;border-radius:0;border-width:1px;display:flex;line-height:1.25rem;padding-left:.5rem;position:relative}.choosy-widget.disabled{background-color:#f3f4f6;cursor:not-allowed}.choosy-widget.disabled input{cursor:not-allowed}.choosy-input{background-color:transparent;border:0;border-radius:0;box-shadow:none!important;display:inline-block;height:1.5rem;max-width:100%;outline:none;padding:0!important;vertical-align:baseline}.choosy-list{align-items:center;display:flex;flex-wrap:wrap;min-height:2.25rem;padding:.25rem 0}.choosy-item{align-items:center;background-color:#4b5563;border-radius:.25rem;box-sizing:border-box;display:inline-flex;font-size:.875rem;height:1.5rem;line-height:1.25rem;margin-bottom:.125rem;margin-right:.25rem;margin-top:.125rem}.choosy-item-text-span{color:#f0f1f1;line-height:1.625;margin-left:.5rem;max-width:20rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.choosy-remove-button{align-items:center;-webkit-appearance:button;background-color:transparent;background-image:none;border:none;box-shadow:none;color:#6b7280;cursor:pointer;display:flex;height:1.5rem;justify-content:center;line-height:inherit;padding:0;text-transform:none;width:1.5rem}.choosy-remove-button:focus{outline:none}.choosy-remove-button:hover{color:#f4f5f7}.choosy-remove-button-svg{height:1.5rem;width:1.5rem}.choosy-result-list-container{background-color:#fff;box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);margin-left:-.5rem;margin-top:2px;position:absolute;top:100%;width:100%;z-index:30}.choosy-result-list{list-style:none;margin:0;overflow:auto;padding:0}.choosy-result-item{color:#4b5563;cursor:pointer;padding:.5rem 2.25rem .5rem .75rem;position:relative}.choosy-result-item.active{background-color:#4b5563;color:#fff}
1+
/**
2+
1. Change the font styles in all browsers.
3+
2. Remove the margin in Firefox and Safari.
4+
*/
5+
button,
6+
input,
7+
optgroup,
8+
select,
9+
textarea {
10+
font-family: inherit;
11+
/* 1 */
12+
font-size: 100%;
13+
/* 1 */
14+
line-height: 1.15;
15+
/* 1 */
16+
margin: 0;
17+
/* 2 */
18+
}
19+
/**
20+
Remove the inheritance of text transform in Edge and Firefox.
21+
1. Remove the inheritance of text transform in Firefox.
22+
*/
23+
button,
24+
select {
25+
/* 1 */
26+
text-transform: none;
27+
}
28+
/**
29+
Correct the inability to style clickable types in iOS and Safari.
30+
*/
31+
button,
32+
[type='button'],
33+
[type='reset'],
34+
[type='submit'] {
35+
-webkit-appearance: button;
36+
}
37+
/**
38+
Remove the inner border and padding in Firefox.
39+
*/
40+
::-moz-focus-inner {
41+
border-style: none;
42+
padding: 0;
43+
}
44+
/**
45+
Restore the focus styles unset by the previous rule.
46+
*/
47+
:-moz-focusring {
48+
outline: 1px dotted ButtonText;
49+
}
50+
/**
51+
Remove the additional ':invalid' styles in Firefox.
52+
See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
53+
*/
54+
:-moz-ui-invalid {
55+
box-shadow: none;
56+
}
57+
/**
58+
Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
59+
*/
60+
legend {
61+
padding: 0;
62+
}
63+
/**
64+
Add the correct vertical alignment in Chrome and Firefox.
65+
*/
66+
progress {
67+
vertical-align: baseline;
68+
}
69+
/**
70+
Correct the cursor style of increment and decrement buttons in Safari.
71+
*/
72+
::-webkit-inner-spin-button,
73+
::-webkit-outer-spin-button {
74+
height: auto;
75+
}
76+
/**
77+
1. Correct the odd appearance in Chrome and Safari.
78+
2. Correct the outline style in Safari.
79+
*/
80+
[type='search'] {
81+
-webkit-appearance: textfield;
82+
/* 1 */
83+
outline-offset: -2px;
84+
/* 2 */
85+
}
86+
/**
87+
Remove the inner padding in Chrome and Safari on macOS.
88+
*/
89+
::-webkit-search-decoration {
90+
-webkit-appearance: none;
91+
}
92+
/**
93+
1. Correct the inability to style clickable types in iOS and Safari.
94+
2. Change font properties to 'inherit' in Safari.
95+
*/
96+
::-webkit-file-upload-button {
97+
-webkit-appearance: button;
98+
/* 1 */
99+
font: inherit;
100+
/* 2 */
101+
}
102+
.choosy-widget {
103+
line-height: 1.25rem;
104+
display: flex;
105+
align-items: center;
106+
padding-left: 0.5rem;
107+
position: relative;
108+
border-color: #e5e7eb;
109+
border-width: 1px;
110+
border-radius: 0;
111+
}
112+
.choosy-widget.disabled {
113+
background-color: #f3f4f6;
114+
cursor: not-allowed;
115+
}
116+
.choosy-widget.disabled input {
117+
cursor: not-allowed;
118+
}
119+
.choosy-input {
120+
background-color: transparent;
121+
display: inline-block;
122+
vertical-align: baseline;
123+
border: 0;
124+
border-radius: 0;
125+
max-width: 100%;
126+
outline: none;
127+
box-shadow: none !important;
128+
height: 1.5rem;
129+
padding: 0 !important;
130+
}
131+
.choosy-list {
132+
align-items: center;
133+
display: flex;
134+
flex-wrap: wrap;
135+
padding: 0.25rem 0;
136+
min-height: 2.25rem;
137+
}
138+
.choosy-item {
139+
background-color: #4b5563;
140+
height: 1.5rem;
141+
display: inline-flex;
142+
align-items: center;
143+
font-size: 0.875rem;
144+
line-height: 1.25rem;
145+
border-radius: 0.25rem;
146+
box-sizing: border-box;
147+
margin-right: 0.25rem;
148+
margin-top: 0.125rem;
149+
margin-bottom: 0.125rem;
150+
}
151+
.choosy-item-text-span {
152+
margin-left: 0.5rem;
153+
overflow: hidden;
154+
text-overflow: ellipsis;
155+
white-space: nowrap;
156+
color: #f0f1f1;
157+
line-height: 1.625;
158+
max-width: 20rem;
159+
}
160+
.choosy-remove-button {
161+
width: 1.5rem;
162+
height: 1.5rem;
163+
padding: 0;
164+
line-height: inherit;
165+
display: flex;
166+
justify-content: center;
167+
align-items: center;
168+
background-color: transparent;
169+
background-image: none;
170+
color: #6b7280;
171+
box-shadow: none;
172+
-webkit-appearance: button;
173+
text-transform: none;
174+
border: none;
175+
cursor: pointer;
176+
}
177+
.choosy-remove-button:focus {
178+
outline: none;
179+
}
180+
.choosy-remove-button:hover {
181+
color: #f4f5f7;
182+
}
183+
.choosy-remove-button-svg {
184+
height: 1.5rem;
185+
width: 1.5rem;
186+
}
187+
.choosy-result-list-container {
188+
position: absolute;
189+
background-color: white;
190+
top: 100%;
191+
margin-top: 2px;
192+
margin-left: -0.5rem;
193+
width: 100%;
194+
z-index: 30;
195+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)
196+
}
197+
.choosy-result-list {
198+
overflow: auto;
199+
list-style: none;
200+
margin: 0;
201+
padding: 0;
202+
}
203+
.choosy-result-item {
204+
cursor: pointer;
205+
position: relative;
206+
padding: 0.5rem 2.25rem 0.5rem 0.75rem;
207+
color: #4b5563;
208+
}
209+
.choosy-result-item.active {
210+
color: white;
211+
background-color: rgba(75, 85, 99, 1);
212+
}

dist/choosy.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/global.choosy.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
"cypress-plugin-tab": "^1.0.5",
2424
"http-server": "^14.1.1",
2525
"postcss": "^8.2.10",
26+
"postcss-cli": "^10.1.0",
2627
"postcss-import": "^15.0.0",
2728
"postcss-nested": "^5.0.5",
2829
"rollup": "^2.45.2",
2930
"rollup-plugin-babel": "^4.4.0",
30-
"rollup-plugin-postcss": "^4.0.0",
3131
"rollup-plugin-uglify": "^6.0.4",
3232
"start-server-and-test": "^1.14.0",
3333
"tslib": "^2.4.1",

postcss.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// import nested from "postcss-nested";
2+
// import postcss_import from "postcss-import";
3+
// import cssnano from "cssnano";
4+
// import * as path from "path";
5+
6+
module.exports = {
7+
plugins: [
8+
require('postcss-nested'),
9+
require('postcss-import'),
10+
// require('cssnano')
11+
],
12+
// from: './src/style/choosy.css',
13+
// to: path.resolve('dist/choosy.min.css')
14+
}

rollup.config.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import babel from 'rollup-plugin-babel';
22
import {uglify} from "rollup-plugin-uglify";
3-
import postcss from 'rollup-plugin-postcss';
4-
import nested from 'postcss-nested';
5-
import postcss_import from 'postcss-import'
6-
import cssnano from 'cssnano';
73
import multiInput from 'rollup-plugin-multi-input';
84
import typescript from '@rollup/plugin-typescript';
95

10-
const path = require('path');
11-
126
export default {
137
input: [
148
{'choosy.min': 'src/choosy.ts'},
15-
{'global.choosy.min': 'src/globalChoosy.ts'}
169
],
1710
onwarn(warning, rollupWarn) {
1811
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
@@ -26,24 +19,12 @@ export default {
2619
sourcemap: 'inline',
2720
},
2821
plugins: [
29-
typescript(),
3022
uglify(),
3123
multiInput(),
3224

3325
babel({
3426
exclude: 'node_modules/**',
3527
}),
36-
37-
postcss({
38-
plugins: [
39-
nested(),
40-
postcss_import(),
41-
cssnano(),
42-
],
43-
extensions: ['.css'],
44-
minimize: true,
45-
extract: path.resolve('dist/choosy.min.css')
46-
}),
47-
28+
typescript()
4829
],
4930
};

0 commit comments

Comments
 (0)