-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK: import Calypso UI into a Gutenberg extension and scope styles #26683
Changes from all commits
9d2bc89
5287c1c
920f61d
bbaed35
99df4ea
7be68db
5e863bc
f5853f0
35541b8
a9fc7eb
d2ab07e
88ae7e4
261fc7d
052349f
c52e42f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@import '../../../assets/stylesheets/shared/_utils.scss'; | ||
|
||
.card { | ||
display: block; | ||
position: relative; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@import '../../../assets/stylesheets/shared/_utils.scss'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We seem to need only:
How do you feel about being even more specific and listing them specifically? Being granular enough will hopefully result in smaller bundle sizes. |
||
|
||
.ribbon { | ||
position: absolute; | ||
right: -5px; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
*/ | ||
import { registerBlockType } from '@wordpress/blocks'; | ||
import { RichText } from '@wordpress/editor'; | ||
import Card from 'components/card'; | ||
import Ribbon from 'components/ribbon'; | ||
|
||
import './style.scss'; | ||
|
||
|
@@ -14,23 +16,16 @@ const attributes = { | |
}, | ||
}; | ||
|
||
const edit = ( { attributes: { notes }, className, isSelected, setAttributes } ) => ( | ||
<div className={ isSelected ? 'is-selected' : '' }> | ||
{ ! isSelected && ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any good reason to be getting rid of this functionality? It was nice to have the notebook icon while editing the block content. |
||
<span className="editor-notes__editor-indicator"> | ||
<span role="img" aria-label="notebook"> | ||
📔 | ||
</span> | ||
Editor's Notes: hidden from rendered page | ||
</span> | ||
) } | ||
const edit = ( { attributes: { notes }, className, setAttributes } ) => ( | ||
<Card highlight="error" className={ `${ className } ${ className }__box calypso` }> | ||
<Ribbon>Hidden</Ribbon> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should localize this string? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We definitely should give it a try! 😍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's wait until we have some more clarity on i18n, before we dip our toes into this :) |
||
<RichText | ||
tagName="p" | ||
className={ className } | ||
value={ notes } | ||
onChange={ newNotes => setAttributes( { notes: newNotes } ) } | ||
/> | ||
</div> | ||
</Card> | ||
); | ||
|
||
const save = () => null; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
.wp-block-a8c-editor-notes { | ||
border: 2px solid gray; | ||
position: relative; | ||
padding: 32px 6px 6px; | ||
background-color: #c0e7ff; | ||
@import '../../../../assets/stylesheets/shared/_colors.scss'; | ||
|
||
.is-selected { | ||
padding-top: 6px; | ||
} | ||
} | ||
|
||
.editor-notes__editor-indicator { | ||
position: absolute; | ||
top: 0; | ||
left: 8px; | ||
font-style: italic; | ||
.wp-block-a8c-editor-notes__box { | ||
background-color: lighten( $alert-red, 40% ); | ||
border-color: $alert-red; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem to need only:
assets/stylesheets/shared/_colors.scss
assets/stylesheets/shared/mixins/clear-fix.scss
assets/stylesheets/shared/mixins/breakpoints.scss
How do you feel about being even more specific and listing them specifically? Being granular enough will hopefully result in smaller bundle sizes.