PolicyStat / ckeditor-plugin-structured-headings

MIT License
0 stars 1 forks source link

Indent Headings and 'Children' items #24

Open BDeveau opened 7 years ago

BDeveau commented 7 years ago

Phase 1

BDeveau commented 7 years ago

Indentation Values Per @janasoroczak: h2: none h3: 15px h4: 30px h5: 45px h6: 60px

caffodian commented 7 years ago

Can we first try this with some site styles and see if it still makes sense?

We can add the settings to the document settings for the site and get a preview that way.

Also, I wish we used ems or rems, but I don't think we are set up properly for that :/

jms21852 commented 7 years ago

@caffodian Could you clarify what is meant by site styles? I came up with these numbers by playing with styles in Chrome Inspector.

caffodian commented 7 years ago

https://pstatdev.pstatbeta.com/admin/doc_settings/ <-- no code changes needed

BDeveau commented 7 years ago

Need code changes for the indentation to apply to all children. Without which, indenting only headings and not contents is not going to test well anyways.

caffodian commented 7 years ago

how so?

BDeveau commented 7 years ago
          HEADER
subtext for that header
                    SUBHEADER
subtext for that

       HEADER
       subtext for that header
                       SUBHEADER
                       subtext for that

... looks weird, and unclear without. IMHO.

caffodian commented 7 years ago

No, I mean, why does it need code changes?

I think you can just use a sibling selector (https://developer.mozilla.org/en/docs/Web/CSS/General_sibling_selectors) and it lasts until the next such selector takes effect

BDeveau commented 7 years ago

OH RIGHT.. hmmmmm.. testing now

caffodian commented 7 years ago

Some change should make it into this code base eventually. But we should make sure everyone accepts the styling (and make sure we don't have unintended consequences on real documents - for example printer friendly sizing )

BDeveau commented 7 years ago

Sibling Selectors don't work quite as expected...

The ~ combinator separates two selectors and matches the second element only if it is preceded by the first, and both share a common parent

This comes out as

h1
p
   h2
   p
      h3
      p

      p
      p

all future paragraphs are indented to the last indentation level, even if not intended to be a part of it, because they all share the common parent of document-body.

caffodian commented 7 years ago

Why are they not intended to be part of it? Because of the break in between?

BDeveau commented 7 years ago

Yes, I mean as long as you're sticking into the structure it works ok, but would that meet user's expectations? They'd need another H1/2 to bring it back into left aligned. Maybe that's not a big deal.

BDeveau commented 7 years ago

Nope, nevermind. This happens:

h1
p
   h2
   p
      h3
      p
h1
      p

it doesn't reset back

caffodian commented 7 years ago

Does it do that if the last h1 is an h2 instead?

My guess is you might have forgotten to have an h1 sibling selector because it's not indented. I could be wrong and I use a lot of reference when playing with general selectors though

BDeveau commented 7 years ago

Yes, because all previous levels of indentation are being applied to thelast P, and it's taking the largest value.

caffodian commented 7 years ago

:(

caffodian commented 7 years ago

http://stackoverflow.com/questions/31872535/css-successive-indenting-of-siblings-after-headings

caffodian commented 7 years ago

It would be nice if one of the approaches in there works. I'm a bit worried about adding more classes than strictly needed

caffodian commented 7 years ago

On the PolicyStat side, it just means more show changes cases to handle :(

BDeveau commented 7 years ago

image