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
53 changes: 53 additions & 0 deletions spec/user_select_spec.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
require "./spec_helper"

module CSS::UserSelectSpec
class Style < CSS::Stylesheet
rule p do
user_select :auto
end

rule span do
user_select :text
end

rule div do
user_select :none
end

rule section do
user_select :contain
end

rule article do
user_select :all
end
end

describe "Style.to_s" do
it "renders supported user-select values" do
expected = <<-CSS
p {
user-select: auto;
}

span {
user-select: text;
}

div {
user-select: none;
}

section {
user-select: contain;
}

article {
user-select: all;
}
CSS

Style.to_s.should eq(expected)
end
end
end
7 changes: 7 additions & 0 deletions src/css/enums/user_select.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
css_enum UserSelect do
Auto
Text
None
Contain
All
end
2 changes: 1 addition & 1 deletion src/stylesheet.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ module CSS
prop transition_timing_function, String
prop translate, String
prop unicode_bidi, String
prop user_select, String
prop user_select, CSS::Enums::UserSelect
prop vector_effect, String
prop vertical_align, CSS::LengthPercentage | CSS::Enums::VerticalAlign
prop view_transition_class, String
Expand Down