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

Adding docs on applying external CSS to a landscape #870

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,30 @@ You can embed the landscape in a website in a few different ways...
<script src="https://landscape.openmainframeproject.org/iframeResizer.js"></script>
```

### Adding CSS styles for an embedded landscape

There are a few different ways to do this.

If you have just a few CSS style defintions to apply, you can add the `css` URL parameter with the CSS style rules; see example URI below:

https://landscape.cncf.io/card-mode?category=kubernetes-training-partner&grouping=category&embed=yes&style=.sh_wrapper%7Bdisplay:none;}.mosaic.nonoss%20img{background:gold%20!important

If you have a CSS file on your website you wish to maintain all the CSS defintions at, you can pass the URL to that CSS file using the `css` URL parameter; see example below ( scroll to the bottom to see the CSS applied ):

https://landscape.cncf.io/card-mode?style=borderless&grouping=license&license=mit-license&embed=yes&css=https://clever-spence-1af20a.netlify.app/1.css

Finally, you can also the `contentWindow.postMessage` javascript call to send style defintions after the page is fully loaded.

```html
<iframe src="https://landscape.aswf.io/pages/hosted-projects" frameborder="0" id="landscape" scrolling="no" style="width: 1px; min-width: 100%; opacity: 1; visibility: visible; overflow: hidden;"></iframe>
<script src="https://landscape.aswf.io/iframeResizer.js"></script>
<script>
window.onload = function() {
document.getElementById("landscape").contentWindow.postMessage({type: 'css', css: 'body {background: #fff;}#embedded-footer, .main > h1 {display: none}.borderless-mode .sh_wrapper {text-align: center;text-transform: uppercase;font-size: 30px !important}.borderless-mode .sh_wrapper span {color: #ba9e5e}.column-content, .column-content [data-section-id] {justify-content: center}'},'*');
}
</script>
```

## Generating a Guide

A Guide can be generated by adding a file `guide.md`. `guide.md` will be mostly regular markdown with some custom behavior:
Expand Down