Skip to content

Commit e269421

Browse files
[AppBar] Add color transparent support
1 parent bd83fd5 commit e269421

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

docs/pages/api/app-bar.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
2626
|:-----|:-----|:--------|:------------|
2727
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
2828
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
29-
| <span class="prop-name">color</span> | <span class="prop-type">'default'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'</span> | <span class="prop-default">'primary'</span> | The color of the component. It supports those theme colors that make sense for this component. |
29+
| <span class="prop-name">color</span> | <span class="prop-type">'default'<br>&#124;&nbsp;'inherit'<br>&#124;&nbsp;'primary'<br>&#124;&nbsp;'secondary'<br>&#124;&nbsp;'transparent'</span> | <span class="prop-default">'primary'</span> | The color of the component. It supports those theme colors that make sense for this component. |
3030
| <span class="prop-name">position</span> | <span class="prop-type">'absolute'<br>&#124;&nbsp;'fixed'<br>&#124;&nbsp;'relative'<br>&#124;&nbsp;'static'<br>&#124;&nbsp;'sticky'</span> | <span class="prop-default">'fixed'</span> | The positioning type. The behavior of the different options is described [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning). Note: `sticky` is not universally supported and will fall back to `static` when unavailable. |
3131

3232
The `ref` is forwarded to the root element.
@@ -50,6 +50,7 @@ Any other props supplied will be provided to the root element ([Paper](/api/pape
5050
| <span class="prop-name">colorPrimary</span> | <span class="prop-name">.MuiAppBar-colorPrimary</span> | Styles applied to the root element if `color="primary"`.
5151
| <span class="prop-name">colorSecondary</span> | <span class="prop-name">.MuiAppBar-colorSecondary</span> | Styles applied to the root element if `color="secondary"`.
5252
| <span class="prop-name">colorInherit</span> | <span class="prop-name">.MuiAppBar-colorInherit</span> | Styles applied to the root element if `color="inherit"`.
53+
| <span class="prop-name">colorTransparent</span> | <span class="prop-name">.MuiAppBar-colorTransparent</span> | Styles applied to the root element if `color="transparent"`.
5354

5455
You can override the style of the component thanks to one of these customization points:
5556

packages/material-ui/src/AppBar/AppBar.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface AppBarProps extends StandardProps<PaperProps, AppBarClassKey> {
55
/**
66
* The color of the component. It supports those theme colors that make sense for this component.
77
*/
8-
color?: PropTypes.Color;
8+
color?: PropTypes.Color | 'transparent';
99
/**
1010
* The positioning type. The behavior of the different options is described
1111
* [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).

packages/material-ui/src/AppBar/AppBar.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ export const styles = theme => {
7171
},
7272
/* Styles applied to the root element if `color="inherit"`. */
7373
colorInherit: {
74-
backgroundColor: 'inherit',
74+
color: 'inherit',
75+
},
76+
/* Styles applied to the root element if `color="transparent"`. */
77+
colorTransparent: {
78+
backgroundColor: 'transparent',
7579
color: 'inherit',
7680
},
7781
};
@@ -121,7 +125,7 @@ AppBar.propTypes = {
121125
/**
122126
* The color of the component. It supports those theme colors that make sense for this component.
123127
*/
124-
color: PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary']),
128+
color: PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary', 'transparent']),
125129
/**
126130
* The positioning type. The behavior of the different options is described
127131
* [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).

0 commit comments

Comments
 (0)