Skip to content

Commit

Permalink
Merge pull request #22 from ThinkUniform/checked-sibling
Browse files Browse the repository at this point in the history
Add checked input subsequent sibling pseudo support
  • Loading branch information
jinsupark authored Dec 27, 2021
2 parents a39eea1 + 2625894 commit aaca659
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/uniform.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! UniformCSS v1.2.7 | MIT License | github.com/ThinkUniform/uniformcss */
/*! UniformCSS v1.3.0 | MIT License | github.com/ThinkUniform/uniformcss */
/*! purgecss start ignore */
:root {
--FONT-FAMILIES-----------------:#01;
Expand Down
2 changes: 1 addition & 1 deletion dist/uniform.min.css

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@
)
);

// -------------------
// New Features v1.2.4
// -------------------
// -----------------------
// New Features v1.2 ~ 1.3
// -----------------------

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

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

// **Localized Important**
// - Enable important locally directly via the utilities settings
// - Enable important locally directly via the utilities settings

// **Other Improvements**
// - You can enable subsequent sibling selector for checked input with `checked-sibling`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uniformcss",
"version": "1.2.7",
"version": "1.3.0",
"description": "A fully configurable utility class generator and CSS framework built for Sass projects.",
"main": "main.sass",
"scripts": {
Expand Down
57 changes: 57 additions & 0 deletions uniform/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,20 @@ $json-set: ();
)
);
$pseudo-set: map.merge($pseudo-set, $map);
} @else if $pseudo == checked-sibling {
$map: (
'#{$compiled-pseudo-name}': (
selector: 'input:checked ~ .#{$compiled-pseudo-name}#{$extra-selector}',
parent: '.#{$compiled-class-name}',
category: pseudo,
extra-selector: $extra-selector,
pseudo: checked-sibling,
properties: (
$compiled-properties
)
)
);
$pseudo-set: map.merge($pseudo-set, $map);
} @else if $pseudo != none {
$map: (
'#{$compiled-pseudo-name}': (
Expand Down Expand Up @@ -542,6 +556,21 @@ $json-set: ();
)
);
$pseudo-set: map.merge($pseudo-set, $map);
} @else if $pseudo == checked-sibling {
$map: (
'#{$compiled-responsive-pseudo-name}#{$compiled-class-name}': (
selector: 'input:checked ~ .#{$compiled-responsive-pseudo-name}#{$compiled-class-name}#{$extra-selector}',
parent: '.#{$screen}#{$screen-delimiter}#{$compiled-class-name}',
category: pseudo,
extra-selector: $extra-selector,
pseudo: checked-sibling,
screen: $screen,
properties: (
$compiled-properties
)
)
);
$pseudo-set: map.merge($pseudo-set, $map);
} @else if $pseudo != none {
$map: (
'#{$compiled-responsive-pseudo-name}#{$compiled-class-name}': (
Expand Down Expand Up @@ -848,6 +877,20 @@ $merged-class-set: map.merge($standard-class-set, $responsive-class-set);
}
}
}
} @else if $pseudo == checked-sibling {
@at-root input:checked ~ & {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
} @else if $pseudo != none {
@at-root &:#{$pseudo} {
@if $extra-selector == null {
Expand Down Expand Up @@ -907,6 +950,20 @@ $merged-class-set: map.merge($standard-class-set, $responsive-class-set);
}
}
}
} @else if $pseudo == checked-sibling {
@at-root input:checked ~ & {
@if $extra-selector == null {
@each $property, $value in $properties {
#{$property}: #{$value};
}
} @else {
& #{$extra-selector} {
@each $property, $value in $properties {
#{$property}: #{$value};
}
}
}
}
} @else if $pseudo != none {
@at-root &:#{$pseudo} {
@if $extra-selector == null {
Expand Down
2 changes: 1 addition & 1 deletion uniform/core/_index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! UniformCSS v1.2.7 | MIT License | github.com/ThinkUniform/uniformcss */
/*! UniformCSS v1.3.0 | MIT License | github.com/ThinkUniform/uniformcss */

@use "sass:map";
@use "sass:list";
Expand Down

0 comments on commit aaca659

Please sign in to comment.