Skip to content

Commit ed7963d

Browse files
committed
Merge branch 'v5-bootstrap-compatible' of https://github.com/coreui/coreui into v5-bootstrap-compatible
2 parents c0fca86 + 5a86f47 commit ed7963d

File tree

18 files changed

+44
-3
lines changed

18 files changed

+44
-3
lines changed

build/postcss.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export default context => {
1111
autoprefixer: {
1212
cascade: false
1313
},
14-
'postcss-combine-duplicated-selectors': {}
14+
'postcss-combine-duplicated-selectors': {},
15+
rtlcss: context.env === 'RTL'
1516
}
1617
}
1718
}

docs/content/components/alerts.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ When an alert is dismissed, the element is completely removed from the page stru
147147

148148
## JavaScript behavior
149149

150+
{{< bootstrap-compatibility >}}
151+
150152
### Initialize
151153

152154
Initialize elements as alerts

docs/content/components/carousel.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ The transition duration of `.carousel-item` can be changed with the `$carousel-t
296296

297297
## Usage
298298

299+
{{< bootstrap-compatibility >}}
300+
299301
### Via data attributes
300302

301303
Utilize data attributes to control the position of the carousel. `data-coreui-slide` allows the keywords `prev` or `next`, which changes the slide position corresponding to its current position. Alternatively, use `data-coreui-slide-to` to pass a raw slide index to the carousel `data-coreui-slide-to="2"`, which moves the slide position to a particular index beginning with `0`.

docs/content/components/collapse.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ If your control element is targeting a single collapsible element – i.e., the
108108
Note that CoreUI for Bootstrap's current implementation does not cover the various *optional* keyboard interactions described in the [WAI-ARIA Authoring Practices 1.1 accordion pattern](https://www.w3.org/TR/wai-aria-practices-1.1/#accordion) - you will need to include these yourself with custom JavaScript.
109109
## Usage
110110

111+
{{< bootstrap-compatibility >}}
112+
111113
The collapse plugin utilizes a few classes to handle the heavy lifting:
112114

113115
- `.collapse` hides the content

docs/content/components/dropdowns.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,8 @@ By default, the dropdown menu is closed when clicking inside or outside the drop
999999

10001000
## Usage
10011001

1002+
{{< bootstrap-compatibility >}}
1003+
10021004
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.show` class on the parent `.dropdown-menu`. The `data-coreui-toggle="dropdown"` attribute is relied on for closing dropdown menus at an application level, so it's a good idea to always use it.
10031005

10041006
{{< callout info >}}

docs/content/components/list-group.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ And if you want `<label>`s as the `.list-group-item` for large hit areas, you ca
305305

306306
## JavaScript behavior
307307

308+
{{< bootstrap-compatibility >}}
309+
308310
Use the tab JavaScript plugin—include it individually or through the compiled `coreui.js` file—to extend our list group to create tabbable panes of local content.
309311

310312
<div class="docs-example" role="tabpanel">

docs/content/components/modal.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ Another override is the option to pop up a modal that covers the user viewport,
758758

759759
## Usage
760760

761+
{{< bootstrap-compatibility >}}
762+
761763
The modal plugin toggles your hidden content on demand, via data attributes or JavaScript. It also overrides default scrolling behavior and generates a `.modal-backdrop` to provide a click area for dismissing shown modals when clicking outside the modal.
762764

763765
### Via data attributes

docs/content/components/navs-tabs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin
377377

378378
## JavaScript behavior
379379

380+
{{< bootstrap-compatibility >}}
381+
380382
Use the tab JavaScript plugin—include it individually or through the compiled `coreui.js` file—to extend our navigational tabs and pills to create tabbable panes of local content, even via dropdown menus.
381383

382384
Dynamic tabbed interfaces, as described in the [<abbr title="Web Accessibility Initiative">WAI</abbr> <abbr title="Accessible Rich Internet Applications">ARIA</abbr> Authoring Practices](https://www.w3.org/TR/wai-aria-practices/#tabpanel), require `role="tablist"`, `role="tab"`, `role="tabpanel"`, and additional `aria-` attributes in order to convey their structure, functionality and current state to users of assistive technologies (such as screen readers). As a best practice, we recommend using `<button>` elements for the tabs, as these are controls that trigger a dynamic change, rather than links that navigate to a new page or location.

docs/content/components/offcanvas.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ Since the offcanvas panel is conceptually a modal dialog, be sure to add `aria-l
253253

254254
## Usage
255255

256+
{{< bootstrap-compatibility >}}
257+
256258
The offcanvas plugin utilizes a few classes and attributes to handle the heavy lifting:
257259

258260
- `.offcanvas` hides the content

docs/content/components/popovers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ For disabled popover triggers, you may also prefer `data-coreui-trigger="hover f
137137

138138
## Usage
139139

140+
{{< bootstrap-compatibility >}}
141+
140142
Enable popovers via JavaScript:
141143

142144
```js

docs/content/components/scrollspy.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ Scrollspy also works with `.list-group`s. Scroll the area next to the list group
231231

232232
## Usage
233233

234+
{{< bootstrap-compatibility >}}
235+
234236
### Via data attributes
235237

236238
To easily add scrollspy behavior to your topbar navigation, add `data-coreui-spy="scroll"` to the element you want to spy on (most typically this would be the `<body>`). Then add the `data-coreui-target` attribute with the ID or class of the parent element of any Bootstrap `.nav` component.

docs/content/components/sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ By default placement for sidebar components is on the left of the viewport, but
242242

243243
## JavaScript behavior
244244

245+
{{< bootstrap-compatibility >}}
246+
245247
### Methods
246248

247249
You can create a sidebar instance with the sidebar constructor, for example:

docs/content/components/toasts.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,11 @@ When using `autohide: false`, you must add a close button to allow users to dism
320320
{{< /example >}}
321321

322322
While technically it's possible to add focusable/actionable controls (such as additional buttons or links) in your toast, you should avoid doing this for autohiding toasts. Even if you give the toast a long [`delay` timeout](#options), keyboard and assistive technology users may find it difficult to reach the toast in time to take action (since toasts don't receive focus when they are displayed). If you absolutely must have further controls, we recommend using a toast with `autohide: false`.
323+
323324
## Usage
324325

326+
{{< bootstrap-compatibility >}}
327+
325328
Initialize toasts via JavaScript:
326329

327330
```js

docs/content/components/tooltips.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ With an SVG:
127127

128128
## Usage
129129

130+
{{< bootstrap-compatibility >}}
131+
130132
The tooltip plugin generates content and markup on demand, and by default places tooltips after their trigger element.
131133

132134
Trigger the tooltip via JavaScript:

docs/content/getting-started/introduction.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ Curious which components explicitly require our JavaScript and Popper? Click the
101101

102102
CoreUI enhances Bootstrap projects by adding advanced components and features, offering a smooth upgrade with minimal adjustments. It retains Bootstrap's familiar structure while introducing new possibilities for UI development.
103103

104+
{{< bootstrap-compatibility >}}
105+
104106
#### CSS
105107

106108
Copy-paste the stylesheet `<link>` into your `<head>` before all other stylesheets to load our CSS.

docs/layouts/partials/stylesheet.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{{- end -}}
1111

1212
{{- else -}}
13-
<link href="/dist/css/themes/bootstrap/bootstrap{{ if eq .Page.Params.direction "rtl" }}.rtl{{ end }}.css" rel="stylesheet">
13+
<link href="/dist/css/coreui{{ if eq .Page.Params.direction "rtl" }}.rtl{{ end }}.css" rel="stylesheet">
1414
{{- end }}
1515

1616
{{- if (ne .Page.Layout "examples") }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div class="docs-callout docs-callout-warning">
2+
<p>
3+
<strong>Heads up!</strong> In our documentation, all examples show <a href="{{ .Site.BaseURL }}getting-started/introduction/#standalone-library">standard CoreUI implementation</a>. If you are using a <a href="{{ .Site.BaseURL }}getting-started/introduction/#bootstrap-replacement">Bootstrap-compatible</a> version of CoreUI, remember to use the following changes:
4+
<ul>
5+
<li>In the constructor, please use <strong>bootstrap</strong> instead of <strong>coreui</strong>. For example, <code>new bootstrap.Alert(...)</code> instead of <code>new coreui.Alert(...)</code></li>
6+
<li>In events, please use <strong>bs</strong> instead of <strong>coreui</strong>, for example <code>close.bs.alert</code> instead of <code>close.coreui.alert</code></li>
7+
<li>In data attributes, please use <strong>bs</strong> instead of <strong>coreui</strong>. For example, <code>data-bs-toggle="..."</code> instead of <code>data-coreui-toggle="..."</code></li>
8+
</ul>
9+
</p>
10+
</div>

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
"scripts": {
2020
"start": "npm-run-all --parallel watch docs-serve",
2121
"bundlewatch": "bundlewatch --config .bundlewatch.config.json",
22-
"css": "npm-run-all css-compile css-prefix css-minify",
22+
"css": "npm-run-all css-compile css-prefix css-rtl css-minify",
2323
"css-compile": "sass --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/",
24+
"css-rtl": "cross-env NODE_ENV=RTL postcss --config build/postcss.config.mjs --dir \"dist/css/themes/bootstrap/\" --ext \".rtl.css\" \"dist/css/themes/bootstrap/*.css\" \"!dist/css/themes/bootstrap/*.min.css\" \"!dist/css/themes/bootstrap/*.rtl.css\"",
2425
"css-lint": "npm-run-all --aggregate-output --continue-on-error --parallel css-lint-*",
2526
"css-lint-stylelint": "stylelint \"**/*.{css,scss}\" --cache --cache-location .cache/.stylelintcache",
2627
"css-lint-vars": "fusv scss/ docs/assets/scss/",

0 commit comments

Comments
 (0)