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

Block styles in the editor.scss #8094

Closed
samikeijonen opened this issue Jul 20, 2018 · 8 comments
Closed

Block styles in the editor.scss #8094

samikeijonen opened this issue Jul 20, 2018 · 8 comments
Labels
[Feature] Blocks Overall functionality of blocks [Type] Question Questions about the design or development of the editor.

Comments

@samikeijonen
Copy link
Contributor

There are Quote styles in the editor.

.wp-block-quote {
	margin: 0;

	cite {
		display: block;
		font-size: $default-font-size;
	}
}

I don't see any reason why they are there. @jasmussen Can you perhaps take a look.

@samikeijonen samikeijonen changed the title Quote styles in the editor Block styles in the editor.scss Jul 20, 2018
@samikeijonen
Copy link
Contributor Author

Same with subhead styles. I'm not sure why these styles need to be in the editor.scss.

@jasmussen
Copy link
Contributor

I'm afk for another week. I can't recall the exact circumstances but I think there was a good reason. @mtias had some thoughts.

@designsimply designsimply added [Type] Question Questions about the design or development of the editor. [Feature] Blocks Overall functionality of blocks labels Jul 20, 2018
@jasmussen
Copy link
Contributor

jasmussen commented Jul 30, 2018

To the initial question about quote styles in the editor, it seems it was added b763387#diff-b11180e4d3335febb0b76d7038a7ad0a, in response to #6947.

I don't personally have a super strong opinion on the stylings of quote citations, but I think I know the reason the font size rule was added back, and I believe it was the same reason why caption styles were added back (see d677a7a):

... adds back the caption styles for images and embeds. This is because the majority of existing themes won't have styles to accommodate the new figcaption markup, and are likely to be styling the WP Captions instead. For those themes, if the caption styles live in the theme.scss file, the captions will appear unstyled or broken.

Some time in the future, this can possibly be revisited and shuffled around.

Similarly, the cite feature for quotes is now available in Gutenberg, but it is likely to be unstyled in the majority of WordPress themes.

Flagging this so Tammie can take a look too.

@jasmussen jasmussen added the Needs Design Feedback Needs general design feedback. label Jul 30, 2018
@samikeijonen
Copy link
Contributor Author

Makes totally sense but should these live in theme.css?

@jasmussen
Copy link
Contributor

That's just it though, if they live in theme.css, you have to opt-in to them, which means few older WordPress themes will have citation styles.

Again, I don't think that's a big issue because the default browser provided styling is just italic: https://codepen.io/joen/pen/wxyBvy — but I do agree it's an issue with captions for images. But let's wait and hear what Tammie thinks.

@samikeijonen
Copy link
Contributor Author

That's just it though, if they live in theme.css, you have to opt-in to them, which means few older WordPress themes will have citation styles.

True but now those styles are in the editor.css so you can't even opt-in those in the front end. I might be missing the big picture here though after being away for a while:)

I guess I'm trying to say that nothing front-end related should live in editor.css because as themer I can't get rid of those styles.

@mtias
Copy link
Member

mtias commented Jul 31, 2018

The editor view, by default, aims to look like "a vanilla theme with no styles that has opted in to theme.scss".

That's why some theme styles are placed in editor.scss. Otherwise, by default, on a theme that is not changing how blocks look, the user would have a hard time making visual sense of a block structure (quotes would look like just another paragraph, etc).

A theme that wants to modify how blocks look can overwrite the default in the editor, and avoid opting-in to styles on the front-end. Hope this helps clarify things a bit.

@mtias mtias closed this as completed Jul 31, 2018
@samikeijonen
Copy link
Contributor Author

Thanks, that clarifies the issue. I just don't like to overwrite anything in the editor since it breaks the CSS architecture in the theme. But not huge issue, just annoying.

@designsimply designsimply added Customization Issues related to Phase 2: Customization efforts and removed [Feature] Blocks Overall functionality of blocks labels Aug 1, 2018
@karmatosed karmatosed removed the Needs Design Feedback Needs general design feedback. label Aug 1, 2018
@designsimply designsimply added [Feature] Blocks Overall functionality of blocks and removed Customization Issues related to Phase 2: Customization efforts labels Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

5 participants