From d0067d7122c4846122d57be4bc4acc1ac001c865 Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Mon, 8 Aug 2011 23:04:24 -0400 Subject: [PATCH 1/2] user-select mixin with docs and tests --- .../compass/css3/_user-interface.scss | 24 +++++++++++++++++++ .../compass/css/user-interface.css | 5 ++++ .../compass/sass/user-interface.scss | 5 ++++ 3 files changed, 34 insertions(+) create mode 100644 frameworks/compass/stylesheets/compass/css3/_user-interface.scss create mode 100644 test/fixtures/stylesheets/compass/css/user-interface.css create mode 100644 test/fixtures/stylesheets/compass/sass/user-interface.scss diff --git a/frameworks/compass/stylesheets/compass/css3/_user-interface.scss b/frameworks/compass/stylesheets/compass/css3/_user-interface.scss new file mode 100644 index 0000000000..96a8162505 --- /dev/null +++ b/frameworks/compass/stylesheets/compass/css3/_user-interface.scss @@ -0,0 +1,24 @@ +@import "shared"; + +// User Interface ------------------------------------------------------------ +// This file can be expanded to handle all the user interface properties as +// they become available in browsers: +// http://www.w3.org/TR/2000/WD-css3-userint-20000216 + +// User Select --------------------------------------------------------------- +// This property controls the selection model and granularity of an element. +// +// @param $select +// [ none | text | toggle | element | elements | all | inherit ] + +@mixin user-select($select) { + $select: unquote($select); + // Mozilla needs prefix on both the -moz-property and the -moz-value + @include experimental(user-select, -moz-#{$select}, + -moz, not -webkit, not -o, not -ms, not -khtml, not official + ); + // others do not + @include experimental(user-select, $select, + not -moz, -webkit, not -o, not -ms, -khtml, official + ); +} \ No newline at end of file diff --git a/test/fixtures/stylesheets/compass/css/user-interface.css b/test/fixtures/stylesheets/compass/css/user-interface.css new file mode 100644 index 0000000000..8b1a1aaee2 --- /dev/null +++ b/test/fixtures/stylesheets/compass/css/user-interface.css @@ -0,0 +1,5 @@ +.user-select { + -moz-user-select: -moz-none; + -webkit-user-select: none; + -khtml-user-select: none; + user-select: none; } diff --git a/test/fixtures/stylesheets/compass/sass/user-interface.scss b/test/fixtures/stylesheets/compass/sass/user-interface.scss new file mode 100644 index 0000000000..5272f014c0 --- /dev/null +++ b/test/fixtures/stylesheets/compass/sass/user-interface.scss @@ -0,0 +1,5 @@ +@import "compass/css3/user-interface"; + +.user-select { + @include user-select(none); +} \ No newline at end of file From f4d1a8255c90d2af9508d3ae78effc1960956bc0 Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Mon, 12 Sep 2011 14:18:15 -0600 Subject: [PATCH 2/2] changelog for user-select --- doc-src/content/CHANGELOG.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index c6573794de..79d8a176a3 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -14,6 +14,11 @@ The Documentation for the [latest stable release](http://compass-style.org/docs/ The Documentation for the [latest preview release](http://beta.compass-style.org/) +0.11.6 (UNRELEASED) +------------------- + +* Added `user-select` mixin to control the selection model and granularity of an element. It accepts one argument (`$select`) from the following options: `none` | `text` | `toggle` | `element` | `elements` | `all` | `inherit`. + 0.11.5 (07/10/2011) -------------------