Skip to content

Commit 746e061

Browse files
committed
refactor: update examples
1 parent 00fffd1 commit 746e061

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/components/DocsExample.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import CIcon from '@coreui/icons-react'
55
import { cilCode, cilMediaPlay } from '@coreui/icons'
66

77
const DocsExample = (props) => {
8-
const { children, href } = props
8+
const { children, href, tabContentClassName } = props
99

1010
const _href = `https://coreui.io/react/docs/${href}`
1111

@@ -25,7 +25,7 @@ const DocsExample = (props) => {
2525
</CNavLink>
2626
</CNavItem>
2727
</CNav>
28-
<CTabContent className="rounded-bottom">
28+
<CTabContent className={`rounded-bottom ${tabContentClassName ? tabContentClassName : ''}`}>
2929
<CTabPane className="p-3 preview" visible>
3030
{children}
3131
</CTabPane>
@@ -37,6 +37,7 @@ const DocsExample = (props) => {
3737
DocsExample.propTypes = {
3838
children: PropTypes.node,
3939
href: PropTypes.string,
40+
tabContentClassName: PropTypes.string,
4041
}
4142

4243
export default React.memo(DocsExample)

src/scss/_example.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010

1111
.tab-content {
12-
background-color: var(--#{$prefix}tertiary-bg) !important;
12+
background-color: rgba(var(--#{$prefix}tertiary-bg-rgb), var(--#{$prefix}bg-opacity, 1)) !important;
1313
}
1414

1515
& + p {

src/views/forms/range/Range.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Range = () => {
1515
Create custom <code>&lt;input type=&#34;range&#34;&gt;</code> controls with{' '}
1616
<code>&lt;CFormRange&gt;</code>.
1717
</p>
18-
<DocsExample href="forms/range">
18+
<DocsExample href="forms/range" tabContentClassName="bg-opacity-10">
1919
<CFormLabel htmlFor="customRange1">Example range</CFormLabel>
2020
<CFormRange id="customRange1" />
2121
</DocsExample>
@@ -32,7 +32,7 @@ const Range = () => {
3232
Add the <code>disabled</code> boolean attribute on an input to give it a grayed out
3333
appearance and remove pointer events.
3434
</p>
35-
<DocsExample href="forms/range#disabled">
35+
<DocsExample href="forms/range#disabled" tabContentClassName="bg-opacity-10">
3636
<CFormLabel htmlFor="disabledRange">Disabled range</CFormLabel>
3737
<CFormRange id="disabledRange" disabled />
3838
</DocsExample>
@@ -50,7 +50,7 @@ const Range = () => {
5050
<code>0</code> and <code>100</code>, respectively. You may specify new values for
5151
those using the <code>min</code> and <code>max</code> attributes.
5252
</p>
53-
<DocsExample href="forms/range#min-and-max">
53+
<DocsExample href="forms/range#min-and-max" tabContentClassName="bg-opacity-10">
5454
<CFormLabel htmlFor="customRange2">Example range</CFormLabel>
5555
<CFormRange min="0" max="5" defaultValue="3" id="customRange2" />
5656
</DocsExample>
@@ -68,7 +68,7 @@ const Range = () => {
6868
specify a <code>step</code> value. In the example below, we double the number of steps
6969
by using <code>step=&#34;0.5&#34;</code>.
7070
</p>
71-
<DocsExample href="forms/range#steps">
71+
<DocsExample href="forms/range#steps" tabContentClassName="bg-opacity-10">
7272
<CFormLabel htmlFor="customRange3">Example range</CFormLabel>
7373
<CFormRange min="0" max="5" step="0.5" defaultValue="3" id="customRange3" />
7474
</DocsExample>

0 commit comments

Comments
 (0)