From 0d2a328dcc8accc0ed4869aa74de89b7cdf542be Mon Sep 17 00:00:00 2001 From: Jon Rohan Date: Fri, 1 Feb 2013 19:23:52 -0500 Subject: [PATCH] making the editor .focused .is-focused for symmetry --- docs/styling.md | 6 +++--- spec/app/editor-spec.coffee | 4 ++-- src/app/editor.coffee | 4 ++-- src/app/text-mate-theme.coffee | 6 +++--- static/editor.css | 4 ++-- themes/atom-dark-syntax.css | 6 +++--- themes/atom-light-syntax.css | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/styling.md b/docs/styling.md index 1632c4e54..847df3fbb 100644 --- a/docs/styling.md +++ b/docs/styling.md @@ -9,8 +9,8 @@ gutter. You can change the background color using the following CSS: ```css -.editor.focused .line.cursor-line, -.editor.focused .line-number.cursor-line { +.editor.is-focused .line.cursor-line, +.editor.is-focused .line-number.cursor-line { background-color: green; } ``` @@ -18,7 +18,7 @@ You can change the background color using the following CSS: You can change the line number foreground color using the following CSS: ```css -.editor.focused .line-number.cursor-line { +.editor.is-focused .line-number.cursor-line { color: blue; } ``` diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index dee1224d0..2d04e5c7d 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -111,11 +111,11 @@ describe "Editor", -> editor.isFocused = false editor.hiddenInput.focus() expect(editor.isFocused).toBeTruthy() - expect(editor).toHaveClass('focused') + expect(editor).toHaveClass('is-focused') editor.hiddenInput.focusout() expect(editor.isFocused).toBeFalsy() - expect(editor).not.toHaveClass('focused') + expect(editor).not.toHaveClass('is-focused') describe "when the activeEditSession's file is modified on disk", -> it "triggers an alert", -> diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 01b8ac40f..161e7505e 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -351,11 +351,11 @@ class Editor extends View @hiddenInput.on 'focus', => @rootView()?.editorFocused(this) @isFocused = true - @addClass 'focused' + @addClass 'is-focused' @hiddenInput.on 'focusout', => @isFocused = false - @removeClass 'focused' + @removeClass 'is-focused' @autosave() if config.get "editor.autosave" @underlayer.on 'click', (e) => diff --git a/src/app/text-mate-theme.coffee b/src/app/text-mate-theme.coffee index cb1d3558a..f2c1d1f92 100644 --- a/src/app/text-mate-theme.coffee +++ b/src/app/text-mate-theme.coffee @@ -44,17 +44,17 @@ class TextMateTheme extends Theme 'color': @translateColor(foreground) @rulesets.push - selector: '.editor.focused .cursor' + selector: '.editor.is-focused .cursor' properties: 'border-color': @translateColor(caret) @rulesets.push - selector: '.editor.focused .selection .region' + selector: '.editor.is-focused .selection .region' properties: 'background-color': @translateColor(selection) @rulesets.push - selector: '.editor.focused .line-number.cursor-line-no-selection, .editor.focused .line.cursor-line' + selector: '.editor.is-focused .line-number.cursor-line-no-selection, .editor.is-focused .line.cursor-line' properties: 'background-color': @translateColor(lineHighlight) diff --git a/static/editor.css b/static/editor.css index f840736cd..ebd85aeaf 100644 --- a/static/editor.css +++ b/static/editor.css @@ -85,8 +85,8 @@ border-left: 1px solid; } -.editor:not(.focused) .cursor, -.editor.focused .cursor.blink-off { +.editor:not(.is-focused) .cursor, +.editor.is-focused .cursor.blink-off { visibility: hidden; } diff --git a/themes/atom-dark-syntax.css b/themes/atom-dark-syntax.css index fbac8c47c..92f39d650 100644 --- a/themes/atom-dark-syntax.css +++ b/themes/atom-dark-syntax.css @@ -3,15 +3,15 @@ color: #c5c8c6; } -.editor.focused .cursor { +.editor.is-focused .cursor { border-color: #FFFFFF; } -.editor.focused .selection .region { +.editor.is-focused .selection .region { background-color: #333333; } -.editor.focused .line-number.cursor-line-no-selection, .editor.focused .line.cursor-line { +.editor.is-focused .line-number.cursor-line-no-selection, .editor.is-focused .line.cursor-line { background-color: rgba(255, 255, 255, 0.14); } diff --git a/themes/atom-light-syntax.css b/themes/atom-light-syntax.css index e7332f155..c86205d69 100644 --- a/themes/atom-light-syntax.css +++ b/themes/atom-light-syntax.css @@ -3,15 +3,15 @@ color: #555; } -.editor.focused .cursor { +.editor.is-focused .cursor { border-color: #000; } -.editor.focused .selection .region { +.editor.is-focused .selection .region { background-color: #afc4da; } -.editor.focused .line-number.cursor-line-no-selection, .editor.focused .line.cursor-line { +.editor.is-focused .line-number.cursor-line-no-selection, .editor.is-focused .line.cursor-line { background-color: rgba(255, 255, 134, 0.34); }