-
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: refactor block CSS name-spacing #26662
Changes from 3 commits
e168f85
278a419
9953bdd
177ac78
3442a6a
62585d9
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 |
---|---|---|
|
@@ -72,7 +72,9 @@ exports.compile = args => { | |
}; | ||
|
||
const name = path.basename( path.dirname( options.editorScript ).replace( /\/$/, '' ) ); | ||
const baseConfig = getBaseConfig( { extensionName: name } ); | ||
const baseConfig = getBaseConfig( { | ||
extensionName: options.namespace ? name : false | ||
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. With
and
is that expected? If so, wouldn't it be more robust if we have the 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. I hid the namespacer tool behind the flag instead of removing it because I think it might still be useful; I'm experimenting with it in #26683 Since it's broken like you describe, it should be considered only for development testing. Do you reckon I should completely remove the namespacer in this PR even if we might add it back later on? 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. |
||
} ); | ||
|
||
const config = { | ||
...baseConfig, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,11 @@ import { registerBlockType } from '@wordpress/blocks'; | |
/** | ||
* Internal dependencies | ||
*/ | ||
import './markdown-editor.scss'; | ||
import JetpackMarkdownBlockEditor from './jetpack-markdown-block-editor'; | ||
import JetpackMarkdownBlockSave from './jetpack-markdown-block-save'; | ||
|
||
registerBlockType( 'jetpack/markdown-block', { | ||
registerBlockType( 'a8c/markdown', { | ||
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. Do we also want to apply that to any other extensions? Publicize still uses 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. Good catch! Updated. 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. Seems like this introduced a bug 😕 See #26726 |
||
title: __( 'Markdown' ), | ||
|
||
description: [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.wp-block-a8c-markdown__placeholder { | ||
opacity: 0.5; | ||
pointer-events: none; | ||
} | ||
.wp-block-a8c-markdown__preview p { | ||
min-height: 1.8em; | ||
white-space: pre-wrap; | ||
} | ||
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. I took this CSS from the original Jetpack-Markdown PR: https://github.com/Automattic/jetpack/pull/9705/files#diff-3e61a3fdc3d89ac00c7baef9a6d68d6c (kudos @Ferdev) I left this bit out because I didn't find it being used anywhere: .wp-block-jetpack-markdown-block__live-preview__token {
/* $dark-gray-300 from Gutenberg _colors.scss */
color: #6c7781;
} ...although it would've been a nice example of importing a Gutenberg variable in. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,64 @@ | ||
.tiled-gallery-square { | ||
clear: both; | ||
margin: 0 0 20px; | ||
overflow: hidden; | ||
} | ||
.tiled-gallery-image { | ||
margin: 2px !important; /* Ensure that this value isn't overridden by themes that give content images blanket margins */ | ||
} | ||
.gallery-group { | ||
float: left; | ||
position: relative; | ||
} | ||
.gallery-row { | ||
overflow: hidden; | ||
} | ||
.tiled-gallery-item { | ||
float: left; | ||
margin: 0; | ||
position: relative; | ||
width: inherit; /* prevents ie8 bug with inline width styles */ | ||
a { /* Needs to reset some properties for theme compatibility */ | ||
background: transparent; | ||
border: none; | ||
color: inherit; | ||
margin: 0; | ||
padding: 0; | ||
text-decoration: none; | ||
width: auto; | ||
.wp-block-a8c-tiled-gallery { | ||
.tiled-gallery-square { | ||
clear: both; | ||
margin: 0 0 20px; | ||
overflow: hidden; | ||
} | ||
figure { | ||
margin: 0; | ||
.tiled-gallery-image { | ||
margin: 2px !important; /* Ensure that this value isn't overridden by themes that give content images blanket margins */ | ||
} | ||
.tiled-gallery-image, | ||
.tiled-gallery-image:hover { /* Needs to reset some properties for theme compatibility */ | ||
background: none; | ||
border: none; | ||
box-shadow: none; | ||
max-width: 100%; | ||
padding: 0; | ||
vertical-align: middle; | ||
.gallery-group { | ||
float: left; | ||
position: relative; | ||
} | ||
.gallery-row { | ||
overflow: hidden; | ||
} | ||
.tiled-gallery-item { | ||
float: left; | ||
margin: 0; | ||
position: relative; | ||
width: inherit; /* prevents ie8 bug with inline width styles */ | ||
a { /* Needs to reset some properties for theme compatibility */ | ||
background: transparent; | ||
border: none; | ||
color: inherit; | ||
margin: 0; | ||
padding: 0; | ||
text-decoration: none; | ||
width: auto; | ||
} | ||
figure { | ||
margin: 0; | ||
} | ||
.tiled-gallery-image, | ||
.tiled-gallery-image:hover { /* Needs to reset some properties for theme compatibility */ | ||
background: none; | ||
border: none; | ||
box-shadow: none; | ||
max-width: 100%; | ||
padding: 0; | ||
vertical-align: middle; | ||
} | ||
} | ||
} | ||
|
||
.tiled-gallery-caption { /* Captions */ | ||
background: #eee; | ||
background: rgba( 255,255,255,0.8 ); | ||
color: #333; | ||
font-size: 13px; | ||
font-weight: 400; | ||
overflow: hidden; | ||
padding: 10px 0; | ||
position: absolute; | ||
bottom: 0; | ||
text-indent: 10px; | ||
text-overflow: ellipsis; | ||
width: 100%; | ||
white-space: nowrap; | ||
} | ||
.tiled-gallery-caption { /* Captions */ | ||
background: #eee; | ||
background: rgba( 255,255,255,0.8 ); | ||
color: #333; | ||
font-size: 13px; | ||
font-weight: 400; | ||
overflow: hidden; | ||
padding: 10px 0; | ||
position: absolute; | ||
bottom: 0; | ||
text-indent: 10px; | ||
text-overflow: ellipsis; | ||
width: 100%; | ||
white-space: nowrap; | ||
} | ||
|
||
.tiled-gallery-item-small .tiled-gallery-caption { /* Smaller captions */ | ||
font-size: 11px; | ||
.tiled-gallery-item-small .tiled-gallery-caption { /* Smaller captions */ | ||
font-size: 11px; | ||
} | ||
} |
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.
Typo here: should be
whether
. Also, I think it's missing a "should" right before "be".