Skip to content

Commit 48d5862

Browse files
committed
- Updated README
1 parent 0a7c230 commit 48d5862

File tree

10 files changed

+121
-119
lines changed

10 files changed

+121
-119
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ $.removeClass(selector, ...classes);
10621062
Remove a style property from each node.
10631063

10641064
- `selector` is a query selector string, a *HTMLElement*, *NodeList*, *HTMLCollection*, [*QuerySet*](docs/QuerySet.md) or an array of nodes.
1065-
- `style` is a string indicating the style property value to remove.
1065+
- `style` is a string indicating the style property to remove.
10661066

10671067
```javascript
10681068
$.removeStyle(selector, style);

dist/fquery.js

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

dist/fquery.js.map

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/fquery.min.js.map

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

docs/QuerySet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ query.removeClass(...classes);
782782

783783
Remove a style property from each node.
784784

785-
- `style` is a string indicating the style property value to remove.
785+
- `style` is a string indicating the style property to remove.
786786

787787
```javascript
788788
query.removeStyle(style);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fr0st/query",
3-
"version": "3.2.5",
3+
"version": "3.2.6",
44
"description": "fQuery is a free, open-source DOM manipulation library for JavaScript.",
55
"keywords": [
66
"dom",

src/attributes/styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function removeClass(selector, ...classes) {
119119

120120
/**
121121
* Remove a style property from each node.
122-
* @param {string|array|HTMLElement|NodeList|HTMLCollection|QuerySet} selector
122+
* @param {string|array|HTMLElement|NodeList|HTMLCollection|QuerySet} selector
123123
* @param {string} style The style name.
124124
*/
125125
export function removeStyle(selector, style) {

src/query/attributes/styles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export function removeClass(...classes) {
5757
/**
5858
* Remove a style property from each node.
5959
* @param {string} style The style name.
60+
* @return {QuerySet} The QuerySet object.
6061
*/
6162
export function removeStyle(style) {
6263
_removeStyle(this, style);
Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
import assert from 'node:assert/strict';
2-
import { exec } from './../../../setup.js';
3-
4-
describe('#removeStyle', function() {
5-
beforeEach(async function() {
6-
await exec((_) => {
7-
document.body.innerHTML =
8-
'<div id="test1" style="background-color: blue; color: white;"></div>' +
9-
'<div id="test2" style="background-color: blue; color: white;"></div>';
10-
});
11-
});
12-
13-
it('removes a style from all nodes', async function() {
14-
assert.strictEqual(
15-
await exec((_) => {
16-
$.removeStyle('div', 'color');
17-
return document.body.innerHTML;
18-
}),
19-
'<div id="test1" style="background-color: blue;"></div>' +
20-
'<div id="test2" style="background-color: blue;"></div>',
21-
);
22-
});
23-
24-
it('works with HTMLElement nodes', async function() {
25-
assert.strictEqual(
26-
await exec((_) => {
27-
$.removeStyle(
28-
document.getElementById('test1'),
29-
'color',
30-
);
31-
return document.body.innerHTML;
32-
}),
33-
'<div id="test1" style="background-color: blue;"></div>' +
34-
'<div id="test2" style="background-color: blue; color: white;"></div>',
35-
);
36-
});
37-
38-
it('works with NodeList nodes', async function() {
39-
assert.strictEqual(
40-
await exec((_) => {
41-
$.removeStyle(
42-
document.querySelectorAll('div'),
43-
'color',
44-
);
45-
return document.body.innerHTML;
46-
}),
47-
'<div id="test1" style="background-color: blue;"></div>' +
48-
'<div id="test2" style="background-color: blue;"></div>',
49-
);
50-
});
51-
52-
it('works with HTMLCollection nodes', async function() {
53-
assert.strictEqual(
54-
await exec((_) => {
55-
$.removeStyle(
56-
document.body.children,
57-
'color',
58-
);
59-
return document.body.innerHTML;
60-
}),
61-
'<div id="test1" style="background-color: blue;"></div>' +
62-
'<div id="test2" style="background-color: blue;"></div>',
63-
);
64-
});
65-
66-
it('works with array nodes', async function() {
67-
assert.strictEqual(
68-
await exec((_) => {
69-
$.removeStyle([
70-
document.getElementById('test1'),
71-
document.getElementById('test2'),
72-
], 'color');
73-
return document.body.innerHTML;
74-
}),
75-
'<div id="test1" style="background-color: blue;"></div>' +
76-
'<div id="test2" style="background-color: blue;"></div>',
77-
);
78-
});
79-
});
1+
import assert from 'node:assert/strict';
2+
import { exec } from './../../../setup.js';
3+
4+
describe('#removeStyle', function() {
5+
beforeEach(async function() {
6+
await exec((_) => {
7+
document.body.innerHTML =
8+
'<div id="test1" style="background-color: blue; color: white;"></div>' +
9+
'<div id="test2" style="background-color: blue; color: white;"></div>';
10+
});
11+
});
12+
13+
it('removes a style from all nodes', async function() {
14+
assert.strictEqual(
15+
await exec((_) => {
16+
$.removeStyle('div', 'color');
17+
return document.body.innerHTML;
18+
}),
19+
'<div id="test1" style="background-color: blue;"></div>' +
20+
'<div id="test2" style="background-color: blue;"></div>',
21+
);
22+
});
23+
24+
it('works with HTMLElement nodes', async function() {
25+
assert.strictEqual(
26+
await exec((_) => {
27+
$.removeStyle(
28+
document.getElementById('test1'),
29+
'color',
30+
);
31+
return document.body.innerHTML;
32+
}),
33+
'<div id="test1" style="background-color: blue;"></div>' +
34+
'<div id="test2" style="background-color: blue; color: white;"></div>',
35+
);
36+
});
37+
38+
it('works with NodeList nodes', async function() {
39+
assert.strictEqual(
40+
await exec((_) => {
41+
$.removeStyle(
42+
document.querySelectorAll('div'),
43+
'color',
44+
);
45+
return document.body.innerHTML;
46+
}),
47+
'<div id="test1" style="background-color: blue;"></div>' +
48+
'<div id="test2" style="background-color: blue;"></div>',
49+
);
50+
});
51+
52+
it('works with HTMLCollection nodes', async function() {
53+
assert.strictEqual(
54+
await exec((_) => {
55+
$.removeStyle(
56+
document.body.children,
57+
'color',
58+
);
59+
return document.body.innerHTML;
60+
}),
61+
'<div id="test1" style="background-color: blue;"></div>' +
62+
'<div id="test2" style="background-color: blue;"></div>',
63+
);
64+
});
65+
66+
it('works with array nodes', async function() {
67+
assert.strictEqual(
68+
await exec((_) => {
69+
$.removeStyle([
70+
document.getElementById('test1'),
71+
document.getElementById('test2'),
72+
], 'color');
73+
return document.body.innerHTML;
74+
}),
75+
'<div id="test1" style="background-color: blue;"></div>' +
76+
'<div id="test2" style="background-color: blue;"></div>',
77+
);
78+
});
79+
});
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import assert from 'node:assert/strict';
2-
import { exec } from './../../../setup.js';
3-
4-
describe('QuerySet #removeStyle', function() {
5-
beforeEach(async function() {
6-
await exec((_) => {
7-
document.body.innerHTML =
8-
'<div id="test1" style="background-color: blue; color: white;"></div>' +
9-
'<div id="test2" style="background-color: blue; color: white;"></div>';
10-
});
11-
});
12-
13-
it('sets a style value for all nodes', async function() {
14-
assert.strictEqual(
15-
await exec((_) => {
16-
$('div').removeStyle('color');
17-
return document.body.innerHTML;
18-
}),
19-
'<div id="test1" style="background-color: blue;"></div>' +
20-
'<div id="test2" style="background-color: blue;"></div>',
21-
);
22-
});
23-
24-
it('returns the QuerySet', async function() {
25-
assert.strictEqual(
26-
await exec((_) => {
27-
const query = $('div');
28-
return query === query.removeStyle('color');
29-
}),
30-
true,
31-
);
32-
});
33-
});
1+
import assert from 'node:assert/strict';
2+
import { exec } from './../../../setup.js';
3+
4+
describe('QuerySet #removeStyle', function() {
5+
beforeEach(async function() {
6+
await exec((_) => {
7+
document.body.innerHTML =
8+
'<div id="test1" style="background-color: blue; color: white;"></div>' +
9+
'<div id="test2" style="background-color: blue; color: white;"></div>';
10+
});
11+
});
12+
13+
it('sets a style value for all nodes', async function() {
14+
assert.strictEqual(
15+
await exec((_) => {
16+
$('div').removeStyle('color');
17+
return document.body.innerHTML;
18+
}),
19+
'<div id="test1" style="background-color: blue;"></div>' +
20+
'<div id="test2" style="background-color: blue;"></div>',
21+
);
22+
});
23+
24+
it('returns the QuerySet', async function() {
25+
assert.strictEqual(
26+
await exec((_) => {
27+
const query = $('div');
28+
return query === query.removeStyle('color');
29+
}),
30+
true,
31+
);
32+
});
33+
});

0 commit comments

Comments
 (0)