Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/selector_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module CSS::SelectorSpec
display :none
end

rule div <= CSS::NthOfType.new(:odd) do
rule div <= nth_of_type(:odd) do
display :none
end

Expand Down
4 changes: 4 additions & 0 deletions src/stylesheet.cr
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ module CSS
CSS::CalcFunctionCall.new(calculation)
end

def self.nth_of_type(exp : Int32 | String | CSS::NthOfType::Static)
CSS::NthOfType.new(exp)
end

# Type-safe helper for length/percentage `clamp()` values.
#
# Note: this helper enforces units for non-zero number literals (same as property setters).
Expand Down