Skip to content
This repository was archived by the owner on May 7, 2021. It is now read-only.

fix(markdown): improve markdown table styling #139

Merged
merged 2 commits into from
Apr 13, 2018

Conversation

kwk
Copy link
Contributor

@kwk kwk commented Apr 13, 2018

Thanks to @sanbornsen for showing me the right place to make these changes.

Rendered tables currently show up in OpenShift.io without borders and without any padding whatsoever. That makes them really hard to identify as tables.

This change adds

  1. a border,
  2. padding and
  3. alternating row colors (taken from the color palette)

to a rendered table.

Before

This is how the rendering of a table looks in OpenShift.io before the style changes:

bildschirmfoto von 2018-04-13 09-50-22

After

And this is how it looks with the style changes (applied in Chrome):

bildschirmfoto von 2018-04-13 09-47-37

Try standalone

Here's a preview of the changes standalone:

https://www.w3schools.com/code/tryit.asp?filename=FQB3L3C4L6CM

Rendered tables currently show up in OpenShift.io without borders and
without any padding whatsoever. That makes them really hard to identify
as tables.

This change adds a border, padding and alternating row colors for a
rendered table.

Here's a preview of the changes standalone:

https://www.w3schools.com/code/tryit.asp?filename=FQB3L3C4L6CM
@kwk kwk self-assigned this Apr 13, 2018
@kwk kwk requested review from sanbornsen and AdamJ April 13, 2018 07:52
src/app/markdown/markdown.component.less
 33:18  ✖  Do not add zeros before a number  number-leading-zero
@nimishamukherjee nimishamukherjee requested a review from SMahil April 13, 2018 08:29
Copy link
Contributor

@sanbornsen sanbornsen left a comment

Choose a reason for hiding this comment

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

That is so cool !!

@AdamJ
Copy link

AdamJ commented Apr 13, 2018

Will this impact any of the other tables where this component is used, as it directly styles HTML elements?

@kwk
Copy link
Contributor Author

kwk commented Apr 13, 2018

Will this impact any of the other tables where this component is used, as it directly styles HTML elements?

@mindreeper2420 I'm styling inside the editor-preview, therefore I thought it can only influence tables within such a preview.

@kwk
Copy link
Contributor Author

kwk commented Apr 13, 2018

[test]

@sanbornsen
Copy link
Contributor

@mindreeper2420 I believe this will only impact tables inside the component which is intended. By default components do encapsulation.

@AdamJ
Copy link

AdamJ commented Apr 13, 2018

@kwk that's what I'm not sure about - the styles are usually all dropped into the <head> area of the site. Not quite sure how to test it :)

@kwk
Copy link
Contributor Author

kwk commented Apr 13, 2018

@kwk that's what I'm not sure about - the styles are usually all dropped into the area of the site. Not quite sure how to test it :)

@mindreeper2420 there already is a style encapsulated alongside my table styles. We can see where it is located in the head right now, can't we? I mean, can you. I'm no good in judging this.

@kwk
Copy link
Contributor Author

kwk commented Apr 13, 2018

@mindreeper2420 I can only find one class for an h1 on this page: https://prod-preview.openshift.io/_home

bildschirmfoto von 2018-04-13 12-25-18

@AdamJ
Copy link

AdamJ commented Apr 13, 2018

@sanbornsen view encapsulation is turned off for this component (from what I saw), as well as the majority of OSIO.

@kwk my biggest concern is if this will have unintended consequences one the Planner table - my thought is no, but I'm not sure :) I'll check the Planner page, to see if anything from this component ends up in the head section. I believe that is the only area that uses this component.

@sanbornsen
Copy link
Contributor

@mindreeper2420 true that it stays in the header but it has separate tags. Well, here is a test example. I kept two simple tables, one inside f8-markdown one outside it. The one outside has no style from the newly added CSS.

screen shot 2018-04-13 at 4 02 51 pm

@AdamJ
Copy link

AdamJ commented Apr 13, 2018

@sanbornsen @kwk I just checked in OSIO and, even though styles from this component are being added to <head>, they are inside of the class .editor-container, so they shouldn't affect anything else. There is currently an <h1> that is being overwritten by this component, but it is not affecting other <h1> elements.

screen shot 2018-04-13 at 6 46 50 am

@sanbornsen
Copy link
Contributor

@mindreeper2420 that sounds harm free then. Shall we merge this?

@kwk kwk merged commit 7e2b7f8 into fabric8-ui:master Apr 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants