From 3b76f889c26a89d9b6505333bce745c96dd30d28 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 14 Jun 2013 17:17:03 +0200 Subject: [PATCH 1/7] Forms: Make [readonly] inputs easily readable --- src/forms/css/forms.css | 11 +++++++---- src/forms/tests/manual/forms.html | 8 +++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/forms/css/forms.css b/src/forms/css/forms.css index 993341e..5aa4958 100644 --- a/src/forms/css/forms.css +++ b/src/forms/css/forms.css @@ -78,15 +78,18 @@ .pure-form input[type="tel"][disabled], .pure-form input[type="color"][disabled], .pure-form select[disabled], -.pure-form textarea[disabled], -.pure-form input[readonly], -.pure-form select[readonly], -.pure-form textarea[readonly] { +.pure-form textarea[disabled] { cursor: not-allowed; background-color: #eaeded; color: #cad2d3; border-color: transparent; } +.pure-form input[readonly], +.pure-form select[readonly], +.pure-form textarea[readonly] { + cursor: not-allowed; + color: #777; +} .pure-form input:focus:invalid, .pure-form textarea:focus:invalid, .pure-form select:focus:invalid { diff --git a/src/forms/tests/manual/forms.html b/src/forms/tests/manual/forms.html index 247a348..c3f6ae8 100644 --- a/src/forms/tests/manual/forms.html +++ b/src/forms/tests/manual/forms.html @@ -250,7 +250,13 @@

Disabled Inputs

Add the disabled attribute to any form control.

- + +
+ +

Readonly Inputs

+

Add the readonly attribute to any form control.

+
+

Rounded Form

From e1545d54e9215927a76fa82474a00c9cf87e247e Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Tue, 9 Jul 2013 17:26:11 -0400 Subject: [PATCH 2/7] Differentiate [readonly] form inputs from [disabled] This commit builds on top of jaseg's commit (4c5caee). Readonly form inputs have a different style from both [disabled] and normal inputs. [readonly] inputs do not have the default :focus style. --- src/forms/css/forms.css | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/forms/css/forms.css b/src/forms/css/forms.css index 5aa4958..609b95e 100644 --- a/src/forms/css/forms.css +++ b/src/forms/css/forms.css @@ -82,14 +82,20 @@ cursor: not-allowed; background-color: #eaeded; color: #cad2d3; - border-color: transparent; } .pure-form input[readonly], .pure-form select[readonly], -.pure-form textarea[readonly] { +.pure-form textarea[readonly], +.pure-form input[readonly]:focus, +.pure-form select[readonly]:focus, +.pure-form textarea[readonly]:focus { cursor: not-allowed; - color: #777; + background: #f3f3f3; + color: #888; + border-color: #ccc; } + + .pure-form input:focus:invalid, .pure-form textarea:focus:invalid, .pure-form select:focus:invalid { From abe3e760544f1f5d893aa4daefb8b9817b4c8287 Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Tue, 9 Jul 2013 17:50:55 -0400 Subject: [PATCH 3/7] update HISTORY.md with [readonly] input enhancement --- HISTORY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 9aa57cf..e850be2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -15,6 +15,8 @@ NEXT * Added `display: block` to `textarea` in `.pure-form-stacked` to fix an alignment issue for subsequent elements (Issue [#90](https://github.com/yui/pure/issues/90)) +* `[readonly]` inputs look visually different to `[disabled]` inputs and +regular inputs. `[readonly]` inputs do not have any `:focus` styles. 0.2.0 (2013-06-11) ------------------ From 561a3d3e04a8218d6b121fe629a0de943eda1cb9 Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Wed, 10 Jul 2013 11:54:22 -0400 Subject: [PATCH 4/7] remove cursor property for readonly inputs --- src/forms/css/forms.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/forms/css/forms.css b/src/forms/css/forms.css index 609b95e..a3a2c75 100644 --- a/src/forms/css/forms.css +++ b/src/forms/css/forms.css @@ -89,7 +89,6 @@ .pure-form input[readonly]:focus, .pure-form select[readonly]:focus, .pure-form textarea[readonly]:focus { - cursor: not-allowed; background: #f3f3f3; color: #888; border-color: #ccc; From e9b1f1bf154a57340441031b3318e28e489f488f Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Wed, 10 Jul 2013 11:54:36 -0400 Subject: [PATCH 5/7] add issue + committer reference --- HISTORY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index e850be2..76706ff 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -16,7 +16,7 @@ NEXT alignment issue for subsequent elements (Issue [#90](https://github.com/yui/pure/issues/90)) * `[readonly]` inputs look visually different to `[disabled]` inputs and -regular inputs. `[readonly]` inputs do not have any `:focus` styles. +regular inputs. `[readonly]` inputs do not have any `:focus` styles. (Issue [#102](https://github.com/yui/pure/issues/102)) (jaseg) 0.2.0 (2013-06-11) ------------------ From 80a741e8a17d815e3f23354f64b02871953cac5f Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Wed, 10 Jul 2013 11:54:59 -0400 Subject: [PATCH 6/7] indent --- HISTORY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 76706ff..ec3e1d8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -16,7 +16,7 @@ NEXT alignment issue for subsequent elements (Issue [#90](https://github.com/yui/pure/issues/90)) * `[readonly]` inputs look visually different to `[disabled]` inputs and -regular inputs. `[readonly]` inputs do not have any `:focus` styles. (Issue [#102](https://github.com/yui/pure/issues/102)) (jaseg) + regular inputs. `[readonly]` inputs do not have any `:focus` styles. (Issue [#102](https://github.com/yui/pure/issues/102)) (jaseg) 0.2.0 (2013-06-11) ------------------ From a25231e90bd2b0d7729215b979711839cf26f754 Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Tue, 16 Jul 2013 12:10:19 -0400 Subject: [PATCH 7/7] modify colors to be consistent with other colors in Pure --- src/forms/css/forms.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/forms/css/forms.css b/src/forms/css/forms.css index a3a2c75..3225110 100644 --- a/src/forms/css/forms.css +++ b/src/forms/css/forms.css @@ -89,8 +89,8 @@ .pure-form input[readonly]:focus, .pure-form select[readonly]:focus, .pure-form textarea[readonly]:focus { - background: #f3f3f3; - color: #888; + background: #eee; /* menu hover bg color */ + color: #777; /* menu text color */ border-color: #ccc; }