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

Add Block: Heading #313

Closed
mtias opened this issue Mar 23, 2017 · 10 comments
Closed

Add Block: Heading #313

mtias opened this issue Mar 23, 2017 · 10 comments
Assignees
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@mtias
Copy link
Member

mtias commented Mar 23, 2017

Attributes

  • Alignment: Left, Right, Center.
  • Heading sizes.

Markup

<!-- wp:heading -->
<h*>Heading</h*>
<!-- /wp -->

States (see all)

image

@mtias mtias added Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Task Issues or PRs that have been broken down into an individual action to take labels Mar 23, 2017
@ellatrix
Copy link
Member

Just like text, would it be necessary here to add the delimiters?

@mtias
Copy link
Member Author

mtias commented Mar 27, 2017

Depends how the parsing shapes up to be. Once things are a bit more settled I'd love to have a dummy post with a few complicated combinations of markup with and without hints, and test reliability and performance.

The rendering of hints is something that could be a boolean attribute of the block definition, depending on implementation.

@aduth
Copy link
Member

aduth commented Apr 25, 2017

How should the heading appear if not focused and contains no text? I suppose it's the same concern for a text block as well. Currently it shows as blank nothingness, and given we've decided against block identifiers on hover, the block's identity only becomes known when selected. Do we want a placeholder? Another more obvious indicator of block type?

@jasmussen
Copy link
Contributor

How should the heading appear if not focused and contains no text?

First thought: some placeholder text. Like "Write heading...", or "Write text..." or something in that vein.

But I do agree that an empty block like that does seem a bit weird if you insert, say, 5 heading blocks in a row. I will think further on this. It could also be an argument in favor of #447

@ellatrix
Copy link
Member

I think a placeholder is fine? It feels a bit like having image block placeholders inserted. For text maybe we shouldn't do anything? It again feels like a special case.

@jasmussen
Copy link
Contributor

I think a placeholder is fine? It feels a bit like having image block placeholders inserted. For text maybe we shouldn't do anything?

Good point. It's also not necessarily that different from picking a headline in the current editor, on a line on which you've typed nothing.

@ellatrix
Copy link
Member

Looking into adding alignment, that will also need grouping. Other than that, what's left here for prototype parity? I also see that this block has formatting now?

@jasmussen
Copy link
Contributor

Looking into adding alignment, that will also need grouping. Other than that, what's left here for prototype parity? I also see that this block has formatting now?

Yeah it probably should not have formatting. That seems like a regression. There has also been a regression in the hover styles for the formatting buttons, which shouldn't be blue, but be outlined. But I'll take a look at that tomorrow.

The prototype technically does have formatting, but not alignment, whereas this ticket suggests the heading should have alignment, but not formatting. Confusing indeed.

Personal opinion: switching a right aligned paragraph with lots of bolds and italics inside should left align and strip out the inline formatting, and the heading should not have either alignments or formatting.

@ellatrix
Copy link
Member

Personal opinion: switching a right aligned paragraph with lots of bolds and italics inside should left align and strip out the inline formatting, and the heading should not have either alignments or formatting.

These may be edge cases, but I do think alignment is useful for headings. Often you'll see people who want to centre a heading, but maybe others feel too that this should be up to the theme.

I also sometimes add formatting to headings, mostly italic, which is valid, even in a WP post title.

@ellatrix
Copy link
Member

Then I think we can close this issue, and have a look at the (looks for word that is like dropdown but different) dropright in a separate issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

4 participants