mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
💀 is-focused.
targeting blurred state instead so normal state styles don't need a special prefix
This commit is contained in:
@@ -9,8 +9,8 @@ gutter.
|
||||
You can change the background color using the following CSS:
|
||||
|
||||
```css
|
||||
.editor.is-focused .line.cursor-line,
|
||||
.editor.is-focused .line-number.cursor-line {
|
||||
.editor .line.cursor-line,
|
||||
.editor .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.is-focused .line-number.cursor-line {
|
||||
.editor .line-number.cursor-line {
|
||||
color: blue;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -111,11 +111,9 @@ describe "Editor", ->
|
||||
editor.isFocused = false
|
||||
editor.hiddenInput.focus()
|
||||
expect(editor.isFocused).toBeTruthy()
|
||||
expect(editor).toHaveClass('is-focused')
|
||||
|
||||
editor.hiddenInput.focusout()
|
||||
expect(editor.isFocused).toBeFalsy()
|
||||
expect(editor).not.toHaveClass('is-focused')
|
||||
|
||||
describe "when the activeEditSession's file is modified on disk", ->
|
||||
it "triggers an alert", ->
|
||||
|
||||
@@ -27,12 +27,12 @@ describe "TextMateTheme", ->
|
||||
'color': '#F8F8F8'
|
||||
|
||||
expect(rulesets[1]).toEqual
|
||||
selector: '.editor.is-focused .cursor'
|
||||
selector: '.editor .cursor'
|
||||
properties:
|
||||
'border-color': '#A7A7A7'
|
||||
|
||||
expect(rulesets[2]).toEqual
|
||||
selector: '.editor.is-focused .selection .region'
|
||||
selector: '.editor .selection .region'
|
||||
properties:
|
||||
'background-color': "rgba(221, 240, 255, 0.2)"
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@ describe "Window", ->
|
||||
$(window).off 'beforeunload'
|
||||
|
||||
describe "window is loaded", ->
|
||||
it "has .is-focused on the body tag", ->
|
||||
expect($("body").hasClass("is-focused")).toBe true
|
||||
it "doesn't have .is-blurred on the body tag", ->
|
||||
expect($("body").hasClass("is-blurred")).toBe false
|
||||
|
||||
it "doesn't have .is-focused on the window blur event", ->
|
||||
it "does have .is-blurred on the window blur event", ->
|
||||
$(window).blur()
|
||||
expect($("body").hasClass("is-focused")).toBe false
|
||||
expect($("body").hasClass("is-blurred")).toBe true
|
||||
|
||||
describe ".close()", ->
|
||||
it "is triggered by the 'core:close' event", ->
|
||||
|
||||
@@ -138,8 +138,8 @@
|
||||
border-left: 1px solid;
|
||||
}
|
||||
|
||||
.editor:not(.is-focused) .cursor,
|
||||
.editor.is-focused .cursor.blink-off {
|
||||
.is-blurred .cursor,
|
||||
.editor .cursor.blink-off {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
color: #c5c8c6;
|
||||
}
|
||||
|
||||
.editor.is-focused .cursor {
|
||||
.editor .cursor {
|
||||
border-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.editor.is-focused .selection .region {
|
||||
.editor .selection .region {
|
||||
background-color: #333333;
|
||||
}
|
||||
|
||||
.editor.is-focused .line-number.cursor-line-no-selection, .editor.is-focused .line.cursor-line {
|
||||
.editor .line-number.cursor-line-no-selection, .editor .line.cursor-line {
|
||||
background-color: rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user