Skip to content

Conversation

@ryankeairns
Copy link
Contributor

@ryankeairns ryankeairns commented Oct 17, 2018

Fixes #23930

Summary

Similar to adding CSS overrides at a page level, this feature allows a user to override styles at a workpad (global) level using a new form input. This is my first foray into writing changes to the JSON workpad, so please kick the tires thoroughly.

One side effect of this change is that I've changed the default Page background to null and, in turn, moved the default white background up one element in the DOM. The reason for doing this was that setting a global background color for all pages seems like a prime use case for the workpad-level global CSS feature. Setting the default page color at the page level (deeper) prevents a user from overriding the color globally. Setting any background color at the Page level (including transparent) will take precedent - you can confirm with in full screen mode.

screenshot 2018-10-17 09 19 05

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

@ryankeairns ryankeairns added WIP Work in progress v7.0.0 v6.5.0 Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// labels Oct 17, 2018
@ryankeairns ryankeairns changed the title WIP [Canvas] Adds workpad-level CSS [Canvas] Adds workpad-level CSS Oct 17, 2018
@ryankeairns ryankeairns removed the WIP Work in progress label Oct 17, 2018
@elastic elastic deleted a comment from elasticmachine Oct 17, 2018
@elastic elastic deleted a comment from elasticmachine Oct 17, 2018
@elastic elastic deleted a comment from ryankeairns Oct 17, 2018
@elasticmachine
Copy link
Contributor

💔 Build Failed

@cqliu1
Copy link
Contributor

cqliu1 commented Oct 18, 2018

@ryankeairns The position of the page looks a bit off on my end, and the checkered background also stretches and shrinks with the vertical space of the workpad.

screen shot 2018-10-18 at 12 12 59 pm

screen shot 2018-10-18 at 12 12 49 pm

screen shot 2018-10-18 at 12 12 41 pm

@ryankeairns
Copy link
Contributor Author

@cqliu1 I'll get that fixed up.

Also of note, I couldn't find an easy way to apply the global styles to the page thumbnails.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@ryankeairns
Copy link
Contributor Author

A couple more to-do items left here:

  • Add an 'Apply stylesheet' button
  • Apply global styles to page thumbnails

@ryankeairns
Copy link
Contributor Author

ryankeairns commented Oct 22, 2018

@cqliu1 regarding the 'Apply stylesheet' button, it's not as straightforward as I had anticipated and it's dissimilar to the other CSS Style argument panel in the sidebar. Workpad config (ie. workpad settings) is a const so it's not clear (to me) on how best to handle state for the textarea input. This is beyond my current level of Redux knowledge so it would be more efficient if an engineer takes this on for the last mile or we walk through it together.

It's a similar situation for the Page Manager preview, I can get the global styles to pass down into this section using style-it, but I ran into some Type issues that prevented me from applying the styles to the thumbnail previews.

@ryankeairns
Copy link
Contributor Author

@cqliu1 can you push up the changes from our zoom discussion (the preview styles and the 'apply stylesheet' button)? Thanks!

@cqliu1
Copy link
Contributor

cqliu1 commented Oct 23, 2018

@ryankeairns I did push up the changes upstream. Can you check if you're pulling upstream?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger spalger added v6.6.0 and removed v6.6.0 labels Oct 25, 2018
@cqliu1 cqliu1 removed the v6.5.0 label Oct 26, 2018
@ryankeairns
Copy link
Contributor Author

@alexfrancoeur @rashidkpc we put this global CSS feature on hold during the 6.5 frenzy, but it has now been rebased and is ready for your review.

Thanks @cqliu1 for chipping in to finish this off!

Copy link
Contributor

@rashidkpc rashidkpc left a comment

Choose a reason for hiding this comment

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

A few comments, but otherwise this looks pretty good!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@ryankeairns
Copy link
Contributor Author

@rashidkpc your feedback has been addressed, this PR is ready for another look.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@rashidkpc rashidkpc left a comment

Choose a reason for hiding this comment

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

Couple comments, but take care of those and go ahead and merge this!

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@ryankeairns ryankeairns merged commit cfb1404 into elastic:master Dec 3, 2018
ryankeairns pushed a commit to ryankeairns/kibana that referenced this pull request Dec 3, 2018
* adds global, workpad css styling feature

* fixes checkered position and default CSS in textarea

* adds global, workpad css styling feature

* fixes checkered position and default CSS in textarea

* Added global styles to page manager

* Added 'apply stylesheet' button

* fix after rebase

* change style to css

* move default workpad CSS class to constant

* unwind the empty page color pieces
ryankeairns pushed a commit to ryankeairns/kibana that referenced this pull request Dec 3, 2018
* adds global, workpad css styling feature

* fixes checkered position and default CSS in textarea

* adds global, workpad css styling feature

* fixes checkered position and default CSS in textarea

* Added global styles to page manager

* Added 'apply stylesheet' button

* fix after rebase

* change style to css

* move default workpad CSS class to constant

* unwind the empty page color pieces
ryankeairns pushed a commit that referenced this pull request Dec 3, 2018
* adds global, workpad css styling feature

* fixes checkered position and default CSS in textarea

* adds global, workpad css styling feature

* fixes checkered position and default CSS in textarea

* Added global styles to page manager

* Added 'apply stylesheet' button

* fix after rebase

* change style to css

* move default workpad CSS class to constant

* unwind the empty page color pieces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v6.6.0 v7.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants