Skip to content
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

Move misplaced style imports to editor.css #14607

Conversation

m-e-h
Copy link
Member

@m-e-h m-e-h commented Mar 25, 2019

Description

Currently there's this in the front-end style.css:

.block-editor-block-list__layout .reusable-block-edit-panel {
	align-items: center;
	background: #f8f9f9;
	border: 1px dashed rgba(145, 151, 162, 0.25);
	border-bottom: none;
	color: #555d66;
	display: flex;
	flex-wrap: wrap;
	font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans,
		Ubuntu, Cantarell, Helvetica Neue, sans-serif;
	font-size: 13px;
	margin: 0 -14px;
	padding: 8px 14px;
	position: relative;
	top: -14px;
}
.block-editor-block-list__layout .block-editor-block-list__layout .reusable-block-edit-panel {
	margin: 0 -14px;
	padding: 8px 14px;
}
.block-editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__spinner {
	margin: 0 5px;
}
.block-editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__info {
	margin-right: auto;
}
.block-editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__label {
	font-weight: 600;
	margin-right: 8px;
	white-space: nowrap;
}
.block-editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__title {
	flex: 1 1 100%;
	font-size: 14px;
	height: 30px;
	margin: 4px 0 8px;
}
.block-editor-block-list__layout .reusable-block-edit-panel .components-button.reusable-block-edit-panel__button {
	flex-shrink: 0;
}
@media (min-width: 960px) {
	.block-editor-block-list__layout .reusable-block-edit-panel {
		flex-wrap: nowrap;
	}
	.block-editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__title {
		margin: 0;
	}
	.block-editor-block-list__layout .reusable-block-edit-panel .components-button.reusable-block-edit-panel__button {
		margin: 0 0 0 5px;
	}
}
.editor-block-list__layout .is-selected .reusable-block-edit-panel {
	border-color: rgba(66, 88, 99, 0.4) rgba(66, 88, 99, 0.4)
		rgba(66, 88, 99, 0.4) transparent;
}
.is-dark-theme .editor-block-list__layout .is-selected .reusable-block-edit-panel {
	border-color: hsla(0, 0%, 100%, 0.45) hsla(0, 0%, 100%, 0.45)
		hsla(0, 0%, 100%, 0.45) transparent;
}
.block-editor-block-list__layout .reusable-block-indicator {
	background: #fff;
	border: 1px dashed #e2e4e7;
	color: #555d66;
	height: 30px;
	padding: 4px;
	position: absolute;
	right: -14px;
	top: -14px;
	width: 30px;
	z-index: 1;
}

I've moved the imports

@import "./block/edit-panel/style.scss";
@import "./block/indicator/style.scss";

from style.scss to editor.scss.

Other changes may be desired.

  • Should the filenames for the individual stylesheets be changed from style.scss to editor.scss?
  • Do these even belong in block-library/?

@m-e-h m-e-h requested a review from chrisvanpatten as a code owner March 25, 2019 01:55
@m-e-h
Copy link
Member Author

m-e-h commented Mar 25, 2019

This PR and #14648 should, from what I can see, finish off this issue. #11668

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

Thank you for this change. I think given that these styles are styles for internal components used by the "block" block (reusable blocks), their name makes sense and they are being imported in the right file. I would only not import them in the middle of the file and I would add them at the end of the file with a comment saying: "Import styles from internal components used by the blocks.

@jorgefilipecosta jorgefilipecosta force-pushed the fix/edit-panel_indicator-style-to-editor-css branch from 8741d83 to 33fcb97 Compare May 30, 2019 11:05
/**
* Import styles from internal editor components used by the blocks.
*/
@import "./block/edit-panel/style.scss";
Copy link
Member

Choose a reason for hiding this comment

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

They should be also renamed to editor.scss if they belong to this group of styles.

Copy link
Member

Choose a reason for hiding this comment

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

The rename was applied.

@jorgefilipecosta jorgefilipecosta force-pushed the fix/edit-panel_indicator-style-to-editor-css branch from 33fcb97 to 243abc7 Compare May 30, 2019 11:30
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Awesome thanks

@jorgefilipecosta jorgefilipecosta force-pushed the fix/edit-panel_indicator-style-to-editor-css branch from 243abc7 to 9cfb1a5 Compare May 30, 2019 13:52
@jorgefilipecosta jorgefilipecosta merged commit 54d6af8 into WordPress:master May 30, 2019
@youknowriad youknowriad added this to the Gutenberg 5.9 milestone Jun 7, 2019
@youknowriad youknowriad added the [Type] Bug An existing feature does not function as intended label Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants