Skip to content

Commit aaca659

Browse files
authored
Merge pull request #22 from ThinkUniform/checked-sibling
Add checked input subsequent sibling pseudo support
2 parents a39eea1 + 2625894 commit aaca659

6 files changed

Lines changed: 71 additions & 11 deletions

File tree

dist/uniform.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! UniformCSS v1.2.7 | MIT License | github.com/ThinkUniform/uniformcss */
1+
/*! UniformCSS v1.3.0 | MIT License | github.com/ThinkUniform/uniformcss */
22
/*! purgecss start ignore */
33
:root {
44
--FONT-FAMILIES-----------------:#01;

dist/uniform.min.css

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

main.scss

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@
1111
)
1212
);
1313

14-
// -------------------
15-
// New Features v1.2.4
16-
// -------------------
14+
// -----------------------
15+
// New Features v1.2 ~ 1.3
16+
// -----------------------
1717

1818
// **Introducing Output Modes**
19-
// - setting `output` to `'css'` outputs CSS (default),
20-
// - you can also output JSON by setting this to `'json'`!
19+
// - Setting `output` to `'css'` outputs CSS (default),
20+
// - You can also output JSON by setting this to `'json'`!
2121
// - or set to `'headless'` to enable headless mode
2222

2323
// **Multi-Property Utilities**
24-
// - you can now generate multi-property utilities directly via the utilities settings
24+
// - You can now generate multi-property utilities directly via the utilities settings
2525

2626
// **Localized Important**
27-
// - Enable important locally directly via the utilities settings
27+
// - Enable important locally directly via the utilities settings
28+
29+
// **Other Improvements**
30+
// - You can enable subsequent sibling selector for checked input with `checked-sibling`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uniformcss",
3-
"version": "1.2.7",
3+
"version": "1.3.0",
44
"description": "A fully configurable utility class generator and CSS framework built for Sass projects.",
55
"main": "main.sass",
66
"scripts": {

uniform/_index.scss

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,20 @@ $json-set: ();
427427
)
428428
);
429429
$pseudo-set: map.merge($pseudo-set, $map);
430+
} @else if $pseudo == checked-sibling {
431+
$map: (
432+
'#{$compiled-pseudo-name}': (
433+
selector: 'input:checked ~ .#{$compiled-pseudo-name}#{$extra-selector}',
434+
parent: '.#{$compiled-class-name}',
435+
category: pseudo,
436+
extra-selector: $extra-selector,
437+
pseudo: checked-sibling,
438+
properties: (
439+
$compiled-properties
440+
)
441+
)
442+
);
443+
$pseudo-set: map.merge($pseudo-set, $map);
430444
} @else if $pseudo != none {
431445
$map: (
432446
'#{$compiled-pseudo-name}': (
@@ -542,6 +556,21 @@ $json-set: ();
542556
)
543557
);
544558
$pseudo-set: map.merge($pseudo-set, $map);
559+
} @else if $pseudo == checked-sibling {
560+
$map: (
561+
'#{$compiled-responsive-pseudo-name}#{$compiled-class-name}': (
562+
selector: 'input:checked ~ .#{$compiled-responsive-pseudo-name}#{$compiled-class-name}#{$extra-selector}',
563+
parent: '.#{$screen}#{$screen-delimiter}#{$compiled-class-name}',
564+
category: pseudo,
565+
extra-selector: $extra-selector,
566+
pseudo: checked-sibling,
567+
screen: $screen,
568+
properties: (
569+
$compiled-properties
570+
)
571+
)
572+
);
573+
$pseudo-set: map.merge($pseudo-set, $map);
545574
} @else if $pseudo != none {
546575
$map: (
547576
'#{$compiled-responsive-pseudo-name}#{$compiled-class-name}': (
@@ -848,6 +877,20 @@ $merged-class-set: map.merge($standard-class-set, $responsive-class-set);
848877
}
849878
}
850879
}
880+
} @else if $pseudo == checked-sibling {
881+
@at-root input:checked ~ & {
882+
@if $extra-selector == null {
883+
@each $property, $value in $properties {
884+
#{$property}: #{$value};
885+
}
886+
} @else {
887+
& #{$extra-selector} {
888+
@each $property, $value in $properties {
889+
#{$property}: #{$value};
890+
}
891+
}
892+
}
893+
}
851894
} @else if $pseudo != none {
852895
@at-root &:#{$pseudo} {
853896
@if $extra-selector == null {
@@ -907,6 +950,20 @@ $merged-class-set: map.merge($standard-class-set, $responsive-class-set);
907950
}
908951
}
909952
}
953+
} @else if $pseudo == checked-sibling {
954+
@at-root input:checked ~ & {
955+
@if $extra-selector == null {
956+
@each $property, $value in $properties {
957+
#{$property}: #{$value};
958+
}
959+
} @else {
960+
& #{$extra-selector} {
961+
@each $property, $value in $properties {
962+
#{$property}: #{$value};
963+
}
964+
}
965+
}
966+
}
910967
} @else if $pseudo != none {
911968
@at-root &:#{$pseudo} {
912969
@if $extra-selector == null {

uniform/core/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! UniformCSS v1.2.7 | MIT License | github.com/ThinkUniform/uniformcss */
1+
/*! UniformCSS v1.3.0 | MIT License | github.com/ThinkUniform/uniformcss */
22

33
@use "sass:map";
44
@use "sass:list";

0 commit comments

Comments
 (0)