Skip to content

Commit 954d4b2

Browse files
committed
docs: update content
1 parent aba72ce commit 954d4b2

File tree

6 files changed

+85
-35
lines changed

6 files changed

+85
-35
lines changed

docs/content/components/popovers.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ One way to initialize all popovers on a page would be to select them by their `d
4242
const popoverTriggerList = document.querySelectorAll('[data-coreui-toggle="popover"]')
4343
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new coreui.Popover(popoverTriggerEl))
4444
```
45-
4645
### Live demo
4746

47+
We use JavaScript similar to the snippet above to render the following live popover. Titles are set via `data-coreui-title` and body content is set via `data-coreui-content`.
48+
49+
{{< callout warning >}}
50+
{{< partial "callouts/warning-data-bs-title-vs-title.md" >}}
51+
{{< /callout >}}
52+
4853
{{< example >}}
4954
<button type="button" class="btn btn-lg btn-danger" data-coreui-toggle="popover" title="Popover title" data-coreui-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
5055
{{< /example >}}

docs/content/components/tooltips.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Things to know when using the tooltip plugin:
3131

3232
Got all that? Great, let's see how they work with some examples.
3333

34-
## Example: Enable tooltips everywhere
34+
## Examples
35+
36+
### Enable tooltips
3537

3638
One way to initialize all tooltips on a page would be to select them by their `data-coreui-toggle` attribute:
3739

@@ -40,7 +42,7 @@ const tooltipTriggerList = document.querySelectorAll('[data-coreui-toggle="toolt
4042
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new coreui.Tooltip(tooltipTriggerEl))
4143
```
4244

43-
## Examples
45+
### Tooltips on links
4446

4547
Hover over the links below to see tooltips:
4648

@@ -49,6 +51,30 @@ Hover over the links below to see tooltips:
4951
</p>
5052
</div>
5153

54+
{{< callout warning >}}
55+
{{< partial "callouts/warning-data-bs-title-vs-title.md" >}}
56+
{{< /callout >}}
57+
58+
### Custom tooltips
59+
60+
{{< added-in "4.2.0" >}}
61+
62+
You can customize the appearance of tooltips using [CSS variables](#variables). We set a custom class with `data-coreui-custom-class="custom-tooltip"` to scope our custom appearance and use it to override a local CSS variable.
63+
64+
{{< scss-docs name="custom-tooltip" file="docs/assets/scss/_component-examples.scss" >}}
65+
66+
67+
{{< example class="tooltip-demo" stackblitz_add_js="true" >}}
68+
<button type="button" class="btn btn-secondary"
69+
data-coreui-toggle="tooltip" data-coreui-placement="top"
70+
data-coreui-custom-class="custom-tooltip"
71+
data-coreui-title="This top tooltip is themed via CSS variables.">
72+
Custom tooltip
73+
</button>
74+
{{< /example >}}
75+
76+
### Directions
77+
5278
Hover over the buttons below to see the four tooltips directions: top, right, bottom, and left. Directions are mirrored when using CoreUI in RTL.
5379

5480
<div class="docs-example tooltip-demo">

docs/content/customize/color-modes.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,54 @@ Here's a look at the JavaScript that powers it. Feel free to inspect our own doc
189189
{{< /js.inline >}}
190190
{{< /example >}}
191191

192+
## Adding theme colors
193+
194+
Adding a new color in `$theme-colors` is not enough for some of our components like [alerts]({{< docsref "/components/alerts" >}}) and [list groups]({{< docsref "/components/list-group" >}}). New colors must also be defined in `$theme-colors-text`, `$theme-colors-bg-subtle`, and `$theme-colors-border-subtle` for light theme; but also in `$theme-colors-text-dark`, `$theme-colors-bg-subtle-dark`, and `$theme-colors-border-subtle-dark` for dark theme.
195+
196+
This is a manual process because Sass cannot generate its own Sass variables from an existing variable or map. In future versions of Bootstrap, we'll revisit this setup to reduce the duplication.
197+
198+
```scss
199+
// Required
200+
@import "functions";
201+
@import "variables";
202+
@import "variables-dark";
203+
204+
// Add a custom color to $theme-colors
205+
$custom-colors: (
206+
"custom-color": #712cf9
207+
);
208+
$theme-colors: map-merge($theme-colors, $custom-colors);
209+
210+
@import "maps";
211+
@import "mixins";
212+
@import "utilities";
213+
214+
// Add a custom color to new theme maps
215+
216+
// Light mode
217+
$custom-colors-text: ("custom-color": #712cf9);
218+
$custom-colors-bg-subtle: ("custom-color": #e1d2fe);
219+
$custom-colors-border-subtle: ("custom-color": #bfa1fc);
220+
221+
$theme-colors-text: map-merge($theme-colors-text, $custom-colors-text);
222+
$theme-colors-bg-subtle: map-merge($theme-colors-bg-subtle, $custom-colors-bg-subtle);
223+
$theme-colors-border-subtle: map-merge($theme-colors-border-subtle, $custom-colors-border-subtle);
224+
225+
// Dark mode
226+
$custom-colors-text-dark: ("custom-color": #e1d2f2);
227+
$custom-colors-bg-subtle-dark: ("custom-color": #8951fa);
228+
$custom-colors-border-subtle-dark: ("custom-color": #e1d2f2);
229+
230+
$theme-colors-text-dark: map-merge($theme-colors-text-dark, $custom-colors-text-dark);
231+
$theme-colors-bg-subtle-dark: map-merge($theme-colors-bg-subtle-dark, $custom-colors-bg-subtle-dark);
232+
$theme-colors-border-subtle-dark: map-merge($theme-colors-border-subtle-dark, $custom-colors-border-subtle-dark);
233+
234+
// Remainder of Bootstrap imports
235+
@import "root";
236+
@import "reboot";
237+
// etc
238+
```
239+
192240
## CSS
193241

194242
### Variables

docs/content/getting-started/download.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,6 @@ Install CoreUI in your Node.js powered apps with [the yarn package](https://yarn
7171
```sh
7272
yarn add @coreui/coreui
7373
```
74-
<!--
75-
### RubyGems
76-
77-
Install CoreUI for Bootstrap in your Ruby apps using [Bundler](https://bundler.io/) (**recommended**) and [RubyGems](https://rubygems.org/) by adding the following line to your [`Gemfile`](https://bundler.io/gemfile.html):
78-
79-
```ruby
80-
gem 'bootstrap', '~> {{< param current_ruby_version >}}'
81-
```
82-
83-
Alternatively, if you're not using Bundler, you can install the gem by running this command:
84-
85-
```sh
86-
gem install bootstrap -v {{< param current_ruby_version >}}
87-
```
88-
89-
[See the gem's README](https://github.com/twbs/bootstrap-rubygem/blob/master/README.md) for further details. -->
9074

9175
### Composer
9276

@@ -95,15 +79,3 @@ You can also install and manage CoreUI's Sass and JavaScript using [Composer](ht
9579
```sh
9680
composer require coreui/coreui:{{< param current_version >}}
9781
```
98-
99-
<!-- ### NuGet
100-
101-
If you develop in .NET, you can also install and manage CoreUI for Bootstrap's [CSS](https://www.nuget.org/packages/bootstrap/) or [Sass](https://www.nuget.org/packages/coreui.sass/) and JavaScript using [NuGet](https://www.nuget.org/):
102-
103-
```powershell
104-
Install-Package bootstrap
105-
```
106-
107-
```powershell
108-
Install-Package coreui.sass
109-
``` -->

docs/content/getting-started/vite.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ With dependencies installed and our project folder ready for us to start coding,
7676
export default {
7777
root: path.resolve(__dirname, 'src'),
7878
server: {
79-
port: 8080,
80-
hot: true
79+
port: 8080
8180
}
8281
}
8382
```

docs/content/utilities/position.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ Here are some real life examples of these classes:
9393
Mails <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-secondary">+99 <span class="visually-hidden">unread messages</span></span>
9494
</button>
9595

96-
<div class="position-relative py-2 px-4 text-bg-dark border border-dark rounded-pill">
97-
Marker <svg width="1em" height="1em" viewBox="0 0 16 16" class="position-absolute top-100 start-50 translate-middle mt-1" fill="#212529" xmlns="http://www.w3.org/2000/svg"><path d="M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>
96+
<div class="position-relative py-2 px-4 text-bg-secondary border border-secondary rounded-pill">
97+
Marker <svg width="1em" height="1em" viewBox="0 0 16 16" class="position-absolute top-100 start-50 translate-middle mt-1" fill="var(--cui-secondary)" xmlns="http://www.w3.org/2000/svg"><path d="M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>
9898
</div>
9999

100100
<button type="button" class="btn btn-primary position-relative">

0 commit comments

Comments
 (0)