Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
CSS style the selector.
  • Loading branch information
jasmussen committed Apr 10, 2017
commit 3b3cd442e626131c46fdb6bce74e8cea3fb1912f
5 changes: 5 additions & 0 deletions editor/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ body.toplevel_page_gutenberg {
ol {
list-style-type: decimal;
}

select {
font-size: 13px;
color: $dark-gray-500;
}
}

.gutenberg__editor {
Expand Down
2 changes: 2 additions & 0 deletions editor/header/mode-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { connect } from 'react-redux';
* Internal dependencies
*/
import './style.scss';
import Dashicon from '../../components/dashicon';

class ModeSwitcher extends wp.element.Component {
constructor() {
Expand Down Expand Up @@ -39,6 +40,7 @@ class ModeSwitcher extends wp.element.Component {
</option>
) }
</select>
<Dashicon icon="arrow-down" />
</div>
);
}
Expand Down
64 changes: 18 additions & 46 deletions editor/header/mode-switcher/style.scss
Original file line number Diff line number Diff line change
@@ -1,64 +1,36 @@
.editor-mode-switcher {
position: relative;
margin-right: $item-spacing;
}

.editor-mode-switcher__toggle {
padding-right: $item-spacing;
color: $dark-gray-500;
padding: $item-spacing;
align-items: center;
cursor: pointer;
border: none;
background: none;
border-right: 1px solid $light-gray-500;
outline: none;
display: flex;
align-items: center;
}

.editor-mode-switcher__content {
position: absolute;
top: 40px;
border: 1px solid $light-gray-500;
color: $dark-gray-500;
min-width: 100px;

button {
padding: 8px;
display: block;
border: none;
background: white;
select {
background: transparent;
line-height: 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No linting to capture it, but we ought to be cautious of mixed spacing in SCSS files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to let you know that I really appreciate this and very much taking notes. Thanks for pushing fixes too.

border: 0;
border-radius: 0;
-webkit-appearance: none;
outline: none;
cursor: pointer;
width: 100%;
box-shadow: none;
padding-right: 24px;
}
}

.editor-mode-switcher__arrow {
border: 10px dashed $light-gray-500;
height: 0;
line-height: 0;
position: absolute;
width: 0;
z-index: 1;
top: -10px;
left: 50%;
margin-left: -10px;
border-bottom-style: solid;
border-top: none;
border-left-color: transparent;
border-right-color: transparent;
svg {
position: relative;
z-index: -1;
margin-left: -24px;
margin-top: -1px;
}

&:before {
top: 2px;
border: 10px solid white;
content: " ";
position: absolute;
left: 50%;
margin-left: -10px;
border-bottom-style: solid;
border-top: none;
border-left-color: transparent;
border-right-color: transparent;
&:hover,
select:hover {
color: $dark-gray-900;
}
}
4 changes: 2 additions & 2 deletions languages/gutenberg.pot
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ msgstr ""
msgid "Align right"
msgstr ""

#: editor/header/mode-switcher/index.js:28
#: editor/header/mode-switcher/index.js:29
msgid "Visual"
msgstr ""

#: editor/header/mode-switcher/index.js:29
#: editor/header/mode-switcher/index.js:30
msgctxt "Name for the Text editor tab (formerly HTML)"
msgid "Text"
msgstr ""
Expand Down