-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/tooltip/remove-basetooltip
- Loading branch information
Showing
28 changed files
with
665 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
"@patternfly/elements": patch | ||
--- | ||
`<pf-text-input>`: pressing `Enter` will request to submit the form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"@patternfly/elements": minor | ||
--- | ||
|
||
✨ Added `<pf-background-image>` | ||
|
||
```html | ||
<pf-background-image | ||
src="/path/to/image.jpg" | ||
src-2x="/path/to/[email protected]" | ||
src-sm="/path/to/image-768.jpg" | ||
src-sm-2x="/path/to/[email protected]" | ||
src-lg="/path/to/image-992.jpg" | ||
></pf-background-image> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
"@patternfly/elements": minor | ||
--- | ||
`<pf-text-input>`: adds `helper-text`, `error-text`, and `validate-on` attributes. Forwards `pattern` attribute | ||
|
||
```html | ||
<pf-text-input id="validated" | ||
error-text="Enter a three digit integer" | ||
helper-text="How much wood could a woodchuck chuck?" | ||
validate-on="blur" | ||
pattern="\d{3}" | ||
required></pf-text-input> | ||
<pf-button id="validate">Validate</pf-button> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Background Image | ||
|
||
A **background image** allows you to place an image in the background of your page or area of a page. | ||
|
||
|
||
## Installation | ||
Load `<pf-background-image>` via CDN: | ||
|
||
```html | ||
<script src="https://jspm.dev/@patternfly/elements/pf-background-image/pf-background-image.js"></script> | ||
|
||
|
||
Or, if you are using [NPM](https://npm.im), install it | ||
|
||
```bash | ||
npm install @patternfly/elements | ||
``` | ||
|
||
Then once installed, import it to your application: | ||
|
||
```js | ||
import '@patternfly/elements/pf-background-image/pf-background-image.js'; | ||
``` | ||
|
||
## Usage | ||
|
||
```html | ||
<pf-background-image | ||
src="image.jpg" | ||
src-2x="image-576.jpg" | ||
src-sm="image-768.jpg" | ||
src-sm-2x="[email protected]" | ||
src-lg="image-1200.jpg" | ||
></pf-background-image> | ||
``` | ||
|
||
[docs]: https://patternflyelements.org/components/background-image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<pf-background-image filter | ||
src="/components/background-image/demo/pfbg.jpg" | ||
src-2x="/components/background-image/demo/pfbg_576.jpg" | ||
src-sm="/components/background-image/demo/pfbg_768.jpg" | ||
src-sm-2x="/components/background-image/demo/[email protected]" | ||
src-lg="/components/background-image/demo/pfbg_1200.jpg"> | ||
<svg slot="filter" xmlns="http://www.w3.org/2000/svg"> | ||
<filter id="image_overlay"> | ||
<feMorphology in="SourceGraphic" operator="dilate" radius="5"></feMorphology> | ||
</filter> | ||
</svg> | ||
</pf-background-image> | ||
|
||
<script type="module"> | ||
import '@patternfly/elements/pf-background-image/pf-background-image.js'; | ||
</script> | ||
|
||
<style> | ||
/* override demo chrome styles */ | ||
html, body { | ||
background-color: transparent; | ||
} | ||
</style> |
18 changes: 18 additions & 0 deletions
18
elements/pf-background-image/demo/pf-background-image.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<pf-background-image filter | ||
src="pfbg.jpg" | ||
src-2x="pfbg_576.jpg" | ||
src-sm="pfbg_768.jpg" | ||
src-sm-2x="[email protected]" | ||
src-lg="pfbg_1200.jpg" | ||
></pf-background-image> | ||
|
||
<script type="module"> | ||
import '@patternfly/elements/pf-background-image/pf-background-image.js'; | ||
</script> | ||
|
||
<style> | ||
/* override demo chrome styles */ | ||
html, body { | ||
background-color: transparent; | ||
} | ||
</style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script type="module" src="pf-background-image.js"></script> | ||
|
||
<pf-background-image | ||
src="/components/background-image/demo/pfbg.jpg" | ||
src-2x="/components/background-image/demo/pfbg_576.jpg" | ||
src-sm="/components/background-image/demo/pfbg_768.jpg" | ||
src-sm-2x="/components/background-image/demo/[email protected]" | ||
src-lg="/components/background-image/demo/pfbg_1200.jpg" | ||
></pf-background-image> | ||
|
||
<section> | ||
<h1>Sibling Content</h1> | ||
<pf-button>Button</pf-button> | ||
</section> | ||
|
||
|
||
<style> | ||
/* override demo chrome styles */ | ||
html, body { | ||
background-color: transparent; | ||
} | ||
section { | ||
color: var(--pf-theme--color--ui-base--text, #fff); | ||
padding: var(--pf-global--spacer--xl, 2rem); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{% renderOverview %} | ||
{% htmlexample class="pf-background-image" %} | ||
<pf-background-image filter | ||
src="/components/background-image/demo/pfbg.jpg" | ||
src-2x="/components/background-image/demo/pfbg_576.jpg" | ||
src-sm="/components/background-image/demo/pfbg_768.jpg" | ||
src-sm-2x="/components/background-image/demo/pfbg_[email protected]" | ||
src-lg="/components/background-image/demo/pfbg_1200.jpg" | ||
></pf-background-image> | ||
{% endhtmlexample %} | ||
|
||
View the [full screen demo](/components/background-image/demo/). | ||
|
||
{% endrenderOverview %} | ||
|
||
{% band header="Usage" %} | ||
### Sibling content w/ no filter | ||
{% htmlexample class="pf-background-image" %} | ||
<pf-background-image | ||
src="/components/background-image/demo/pfbg.jpg" | ||
src-2x="/components/background-image/demo/pfbg_576.jpg" | ||
src-sm="/components/background-image/demo/pfbg_768.jpg" | ||
src-sm-2x="/components/background-image/demo/pfbg_[email protected]" | ||
src-lg="/components/background-image/demo/pfbg_1200.jpg" | ||
></pf-background-image> | ||
<p>Sibling Content</p> | ||
<pf-button>Button</pf-button> | ||
{% endhtmlexample %} | ||
|
||
View the [full screen demo](/components/background-image/demo/sibling-content/). | ||
|
||
### Override SVG Filter | ||
|
||
[MDN documentation for `<filter>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/filter) | ||
|
||
{% htmlexample class="pf-background-image" %} | ||
<pf-background-image filter | ||
src="/components/background-image/demo/pfbg.jpg" | ||
src-2x="/components/background-image/demo/pfbg_576.jpg" | ||
src-sm="/components/background-image/demo/pfbg_768.jpg" | ||
src-sm-2x="/components/background-image/demo/pfbg_[email protected]" | ||
src-lg="/components/background-image/demo/pfbg_1200.jpg" > | ||
<svg slot="filter" xmlns="http://www.w3.org/2000/svg"> | ||
<filter id="image_overlay"> | ||
<feMorphology in="SourceGraphic" operator="dilate" radius="5"></feMorphology> | ||
</filter> | ||
</svg> | ||
</pf-background-image> | ||
{% endhtmlexample %} | ||
|
||
View the [full screen demo](/components/background-image/demo/filter-override/). | ||
|
||
{% endband %} | ||
|
||
{% renderSlots %}{% endrenderSlots %} | ||
|
||
{% renderAttributes %}{% endrenderAttributes %} | ||
|
||
{% renderMethods %}{% endrenderMethods %} | ||
|
||
{% renderEvents %}{% endrenderEvents %} | ||
|
||
{% renderCssCustomProperties %}{% endrenderCssCustomProperties %} | ||
|
||
{% renderCssParts %}{% endrenderCssParts %} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
:host { | ||
display: flex; | ||
|
||
--_background-image: var(--pf-c-background-image--BackgroundImage); | ||
} | ||
|
||
#outer-container { | ||
display: contents; | ||
} | ||
|
||
#container { | ||
padding: 0; | ||
margin: 0; | ||
background-color: transparent; | ||
} | ||
|
||
#container::after { | ||
display: block; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
z-index: -1; | ||
width: 100%; | ||
height: 100%; | ||
content: ""; | ||
background-color: var(--pf-c-background-image--BackgroundColor, var(--pf-global--BackgroundColor--dark-100, #151515)); | ||
background-image: var(--_background-image); | ||
filter: var(--pf-c-background-image--Filter, url("#image_overlay")); | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
} | ||
|
||
slot[name="filter"] { | ||
display: none; | ||
} | ||
|
||
slot[part="content"] { | ||
display: block; | ||
position: relative; | ||
z-index: 1; | ||
color: white; | ||
} | ||
|
||
@media screen and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { | ||
#container::after { | ||
background-image: var(--pf-c-background-image--BackgroundImage-2x, var(--_background-image-2x, var(--_background-image))); | ||
} | ||
} | ||
|
||
@media screen and (min-width: 576px) { | ||
#container::after { | ||
background-image: var(--pf-c-background-image--BackgroundImage--sm, var(--_background-image-sm, var(--_background-image))); | ||
} | ||
} | ||
|
||
@media screen and (min-width: 576px) and (-webkit-min-device-pixel-ratio: 2), (min-width: 576px) and (min-resolution: 192dpi) { | ||
#container::after { | ||
background-image: var(--pf-c-background-image--BackgroundImage--sm-2x, var(--_background-image-sm-2x, var(--_background-image))); | ||
} | ||
} | ||
|
||
@media screen and (min-width: 992px) { | ||
#container::after { | ||
background-image: var(--pf-c-background-image--BackgroundImage--lg, var(--_background-image-lg, var(--_background-image))); | ||
} | ||
} |
Oops, something went wrong.