Skip to content

Commit 92faa07

Browse files
committed
Merge branch 'v4-dev' into v4-dev-auto-changelog
# Conflicts: # package.json
2 parents 38e4884 + 454ccf4 commit 92faa07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+729
-2187
lines changed

build/postcss.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = ctx => {
1313
autoprefixer: {
1414
cascade: false
1515
},
16+
'postcss-combine-duplicated-selectors': {},
1617
rtlcss: ctx.env === 'RTL' ? {} : false
1718
}
1819
}

docs/assets/js/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
}
114114

115115
// Insert copy to clipboard button before .highlight
116-
var btnHtml = '<div class="docs-clipboard"><button type="button" class="btn-clipboard btn-ghost-primary" title="Copy to clipboard"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><polygon fill="var(--ci-primary-color, currentColor)" points="408 432 376 432 376 464 112 464 112 136 144 136 144 104 80 104 80 496 408 496 408 432" class="ci-primary"/><path fill="var(--ci-primary-color, currentColor)" d="M176,16V400H496V153.373L358.627,16ZM464,368H208V48H312V200H464Zm0-200H344V48h1.372L464,166.627Z" class="ci-primary"/></svg></button></div>'
116+
var btnHtml = '<div class="docs-clipboard"><button type="button" class="btn-clipboard btn btn-ghost-primary" title="Copy to clipboard"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><polygon fill="var(--ci-primary-color, currentColor)" points="408 432 376 432 376 464 112 464 112 136 144 136 144 104 80 104 80 496 408 496 408 432" class="ci-primary"/><path fill="var(--ci-primary-color, currentColor)" d="M176,16V400H496V153.373L358.627,16ZM464,368H208V48H312V200H464Zm0-200H344V48h1.372L464,166.627Z" class="ci-primary"/></svg></button></div>'
117117
document.querySelectorAll('div.highlight')
118118
.forEach(function (element) {
119119
element.insertAdjacentHTML('beforebegin', btnHtml)

docs/assets/scss/_layout.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.wrapper {
22
width: 100%;
3-
padding-left: var(--cui-sidebar-occupy, 0);
3+
padding-left: var(--cui-sidebar-occupy-start, 0);
44
transform: translateZ(0);
55
will-change: auto;
66
@include transition(padding .15s);

docs/content/4.0/components/progress.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,96 @@ The striped gradient can also be animated. Add `.progress-bar-animated` to `.pro
138138
</div>
139139
```
140140

141+
## Progress group
142+
143+
{{< example >}}
144+
<div class="progress-group mb-4">
145+
<div class="progress-group-prepend">
146+
<span class="text-medium-emphasis small">
147+
Title
148+
</span>
149+
</div>
150+
<div class="progress-group-bars">
151+
<div class="progress progress-xs">
152+
<div class="progress-bar bg-info" role="progressbar" style="width: 34%" aria-valuenow="34" aria-valuemin="0" aria-valuemax="100"></div>
153+
</div>
154+
<div class="progress progress-xs">
155+
<div class="progress-bar bg-danger" role="progressbar" style="width: 78%" aria-valuenow="78" aria-valuemin="0" aria-valuemax="100"></div>
156+
</div>
157+
</div>
158+
</div>
159+
<div class="progress-group mb-4">
160+
<div class="progress-group-prepend">
161+
<span class="text-medium-emphasis small">
162+
Title
163+
</span>
164+
</div>
165+
<div class="progress-group-bars">
166+
<div class="progress progress-xs">
167+
<div class="progress-bar bg-info" role="progressbar" style="width: 56%" aria-valuenow="56" aria-valuemin="0" aria-valuemax="100"></div>
168+
</div>
169+
<div class="progress progress-xs">
170+
<div class="progress-bar bg-danger" role="progressbar" style="width: 94%" aria-valuenow="94" aria-valuemin="0" aria-valuemax="100"></div>
171+
</div>
172+
<div class="progress progress-xs">
173+
<div class="progress-bar bg-success" role="progressbar" style="width: 67%" aria-valuenow="67" aria-valuemin="0" aria-valuemax="100"></div>
174+
</div>
175+
</div>
176+
</div>
177+
<div class="progress-group mb-4">
178+
<div class="progress-group-prepend">
179+
<span class="text-medium-emphasis small">
180+
Title
181+
</span>
182+
</div>
183+
<div class="progress-group-bars">
184+
<div class="progress progress-xs">
185+
<div class="progress-bar bg-info" role="progressbar" style="width: 56%" aria-valuenow="56" aria-valuemin="0" aria-valuemax="100"></div>
186+
</div>
187+
<div class="progress progress-xs">
188+
<div class="progress-bar bg-danger" role="progressbar" style="width: 94%" aria-valuenow="94" aria-valuemin="0" aria-valuemax="100"></div>
189+
</div>
190+
<div class="progress progress-xs">
191+
<div class="progress-bar bg-success" role="progressbar" style="width: 67%" aria-valuenow="67" aria-valuemin="0" aria-valuemax="100"></div>
192+
</div>
193+
<div class="progress progress-xs">
194+
<div class="progress-bar bg-warning" role="progressbar" style="width: 17%" aria-valuenow="17" aria-valuemin="0" aria-valuemax="100"></div>
195+
</div>
196+
</div>
197+
</div>
198+
{{< /example >}}
199+
200+
{{< example >}}
201+
<div class="progress-group">
202+
<div class="progress-group-header">
203+
<i class="cil-user progress-group-icon me-2"></i>
204+
<div>Male</div>
205+
<div class="ms-auto font-weight-bold">43%</div>
206+
</div>
207+
<div class="progress-group-bars">
208+
<div class="progress progress-xs">
209+
<div class="progress-bar bg-warning" role="progressbar" style="width: 43%" aria-valuenow="43" aria-valuemin="0" aria-valuemax="100"></div>
210+
</div>
211+
</div>
212+
</div>
213+
{{< /example >}}
214+
215+
{{< example >}}
216+
<div class="progress-group">
217+
<div class="progress-group-header align-items-end">
218+
<i class="cil-globe-alt progress-group-icon me-2"></i>
219+
<div>Organic Search</div>
220+
<div class="ms-auto font-weight-bold me-2">191.235</div>
221+
<div class="text-muted small">(56%)</div>
222+
</div>
223+
<div class="progress-group-bars">
224+
<div class="progress progress-xs">
225+
<div class="progress-bar bg-success" role="progressbar" style="width: 56%" aria-valuenow="56" aria-valuemin="0" aria-valuemax="100"></div>
226+
</div>
227+
</div>
228+
</div>
229+
{{< /example >}}
230+
141231
## Customizing
142232

143233
### SASS

docs/content/4.0/getting-started/rtl.md

Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ We recommend getting familiar with CoreUI for Bootstrap first by reading through
1212

1313
You may also want to read up on [the RTLCSS project](https://rtlcss.com/), as it powers our approach to RTL.
1414

15-
{{< callout warning >}}
16-
### Experimental feature
17-
18-
The RTL feature is still **experimental** and will probably evolve according to user feedback. Spotted something or have an improvement to suggest? [Open an issue]({{< param repo >}}/issues/new), we'd love to get your insights.
19-
{{< /callout >}}
20-
2115
## Required HTML
2216

2317
There are two strict requirements for enabling RTL in Bootstrap-powered pages.
@@ -67,43 +61,20 @@ You can see the above requirements reflected in this modified RTL starter templa
6761

6862
## Approach
6963

70-
Our approach to building RTL support into CoreUI for Bootstrap comes with two important decisions that impact how we write and use our CSS:
64+
Our approach to building RTL support into CoreUI comes with two important decisions that impact how we write and use our CSS:
7165

72-
1. **First, we decided to build it with the [RTLCSS](https://rtlcss.com/) project.** This gives us some powerful features for managing changes and overrides when moving from LTR to RTL. It also allows us to build two versions of CoreUI for Bootstrap from one codebase.
66+
1. **First, as in CoreUI 3 we decided to build it with our own mixins** This gives us full control and allows us to generate LTR and RTL separately, or if needed one stylesheet with both versions without any style's duplicates.
7367

74-
2. **Second, we've renamed a handful of directional classes to adopt a logical properties approach.** Most of you have already interacted with logical properties thanks to our flex utilities—they replace direction properties like `left` and `right` in favor `start` and `end`. That makes the class names and values appropriate for LTR and RTL without any overhead.
68+
2. **Second, in CoreUI 3 we introduced a handful of directional classes ex. `mfs-auto`, but in CoreUI 4 we've simplified them ex. `ms-auto`, and renamed all directional classes to adopt a logical properties approach.** Most of you have already interacted with logical properties thanks to our flex utilities—they replace direction properties like `left` and `right` in favor `start` and `end`. That makes the class names and values appropriate for LTR and RTL without any overhead.
7569

7670
For example, instead of `.ml-3` for `margin-left`, use `.ms-3`.
7771

7872
Working with RTL, through our source Sass or compiled CSS, shouldn't be much different from our default LTR though.
7973

8074
## Customize from source
8175

82-
When it comes to [customization]({{< docsref "/customize/sass" >}}), the preferred way is to take advantage of variables, maps, and mixins. This approach works the same for RTL, even if it's post-processed from the compiled files, thanks to [how RTLCSS works](https://rtlcss.com/learn/getting-started/why-rtlcss/).
83-
84-
### Custom RTL values
85-
86-
Using [RTLCSS value directives](https://rtlcss.com/learn/usage-guide/value-directives/), you can make a variable output a different value for RTL. For example, to decrease the weight for `$font-weight-bold` throughout the codebase, you may use the `/*rtl: {value}*/` syntax:
87-
88-
```scss
89-
$font-weight-bold: 700 #{/* rtl:600 */} !default;
90-
```
91-
92-
Which would ouput to the following for our default CSS and RTL CSS:
93-
94-
```css
95-
/* coreui.css */
96-
dt {
97-
font-weight: 700 /* rtl:600 */;
98-
}
99-
100-
/* coreui.rtl.css */
101-
dt {
102-
font-weight: 600;
103-
}
104-
```
105-
106-
### Alternative font stack
76+
When it comes to [customization]({{< docsref "/customize/sass" >}}), the preferred way is to take advantage of variables, maps, and mixins.
77+
<!-- TODO: find solution ### Alternative font stack
10778
10879
In the case you're using a custom font, be aware that not all fonts support the non-Latin alphabet. To switch from Pan-European to Arabic family, you may need to use `/*rtl:insert: {value}*/` in your font stack to modify the names of font families.
10980
@@ -130,47 +101,19 @@ $font-family-sans-serif:
130101
sans-serif,
131102
// Emoji fonts
132103
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
133-
```
104+
``` -->
134105

135106
### LTR and RTL at the same time
136107

137-
Need both LTR and RTL on the same page? Thanks to [RTLCSS String Maps](https://rtlcss.com/learn/usage-guide/string-map/), this is pretty straightforward. Wrap your `@import`s with a class, and set a custom rename rule for RTLCSS:
108+
Need both LTR and RTL on the same page? All you have to do is set following variables:
138109

139110
```scss
140-
/* rtl:begin:options: {
141-
"autoRename": true,
142-
"stringMap":[
143-
"name": "ltr-rtl",
144-
"priority": 100,
145-
"search": ["ltr"],
146-
"replace": ["rtl"],
147-
"options": {
148-
"scope": "*",
149-
"ignoreCase": false
150-
}
151-
]
152-
} */
153-
.ltr {
154-
@import "../node_modules/bootstrap/scss/bootstrap";
155-
}
156-
/*rtl:end:options*/
111+
$enable-ltr: true;
112+
$enable-rtl: true;
157113
```
158114

159115
After running Sass then RTLCSS, each selector in your CSS files will be prepended by `.ltr`, and `.rtl` for RTL files. Now you're able to use both files on the same page, and simply use `.ltr` or `.rtl` on your components wrappers to use one or the other direction.
160116

161-
{{< callout warning >}}
162-
#### Edge cases and known limitations
163-
164-
While this approach is understandable, please pay attention to the following:
165-
166-
1. When switching `.ltr` and `.rtl`, make sure you add `dir` and `lang` attributes accordingly.
167-
2. Loading both files can be a real performance bottleneck: consider some [optimization]({{< docsref "/customize/optimize" >}}), and maybe try to [load one of those files asynchronously](https://www.filamentgroup.com/lab/load-css-simpler/).
168-
3. Nesting styles this way will prevent our `form-validation-state()` mixin from working as intended, thus require you tweak it a bit by yourself. [See #31223](https://github.com/twbs/bootstrap/issues/31223).
169-
{{< /callout >}}
170-
171-
## The breadcrumb case
172-
173-
The [breadcrumb separator]({{< docsref "/components/breadcrumb" >}}/#changing-the-separator) is the only case requiring its own brand new variable— namely `$breadcrumb-divider-flipped` —defaulting to `$breadcrumb-divider`.
174117

175118
## Additional resources
176119

docs/layouts/partials/head.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@
1919
{{ partial "favicons" . }}
2020
{{ partial "social" . }}
2121
{{ partial "analytics" . }}
22+
23+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@coreui/[email protected]/css/free.min.css" integrity="sha256-vejWHgYduBq3SYXJHSWSRJp7ktQpZ6d+8HGFtb9Fz9k=" crossorigin="anonymous">
24+
25+

docs/layouts/partials/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</a>
2727

2828
{{- if $group.pages }}
29-
<ul class="nav-group-items sidebar-nav-sm">
29+
<ul class="nav-group-items compact">
3030
{{- range $doc := $group.pages -}}
3131
{{- $doc_slug := $doc.title | urlize -}}
3232
{{- $is_active := and $is_active_group (eq $page_slug $doc_slug) -}}

js/src/navigation.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ class Navigation extends BaseComponent {
9595

9696
_setActiveLink() {
9797
Array.from(this._element.querySelectorAll(SELECTOR_NAV_LINK)).forEach(element => {
98+
if (element.classList.contains(CLASS_NAME_NAV_GROUP_TOGGLE)) {
99+
return
100+
}
101+
98102
let currentUrl = String(window.location)
99103

100104
const urlHasParams = /\?.*=/

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
"scripts": {
1818
"start": "npm-run-all --parallel watch docs-serve",
1919
"bundlewatch": "bundlewatch --config .bundlewatch.config.json",
20-
"changelog": "auto-changelog --template changelog.hbs --commit-limit false --package --backfill-limit 0 --starting-version v4.0.0-alpha.0",
21-
"css": "npm-run-all css-compile css-prefix css-rtl css-minify",
20+
"changelog": "auto-changelog --template build/changelog-template.hbs --commit-limit false --package --backfill-limit 0 --starting-version v4.0.0-alpha.2",
21+
"css": "npm-run-all css-compile css-prefix css-minify",
2222
"css-compile": "sass --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/",
23-
"css-rtl": "cross-env NODE_ENV=RTL postcss --config build/postcss.config.js --dir \"dist/css\" --ext \".rtl.css\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*.rtl.css\"",
2423
"css-lint": "npm-run-all --continue-on-error --parallel css-lint-*",
2524
"css-lint-stylelint": "stylelint \"**/*.{css,scss}\" --cache --cache-location .cache/.stylelintcache --rd",
2625
"css-lint-vars": "fusv scss/ docs/assets/scss/",
@@ -67,7 +66,6 @@
6766
"netlify": "cross-env-shell HUGO_BASEURL=$DEPLOY_PRIME_URL npm-run-all dist release-sri docs-build",
6867
"watch": "npm-run-all --parallel watch-*",
6968
"watch-css-main": "nodemon --watch scss/ --ext scss --exec \"npm-run-all css-lint css-compile css-prefix\"",
70-
"watch-css-dist": "nodemon --watch dist/css/ --ext css --ignore \"dist/css/*.rtl.*\" --exec \"npm run css-rtl\"",
7169
"watch-css-docs": "nodemon --watch docs/assets/scss/ --ext scss --exec \"npm run css-lint\"",
7270
"watch-js-main": "nodemon --watch js/src/ --ext js --exec \"npm-run-all js-lint js-compile\"",
7371
"watch-js-docs": "nodemon --watch docs/assets/js/ --ext js --exec \"npm run js-lint\""
@@ -126,6 +124,7 @@
126124
"npm-run-all": "^4.1.5",
127125
"postcss": "^8.2.6",
128126
"postcss-cli": "^8.3.1",
127+
"postcss-combine-duplicated-selectors": "^10.0.2",
129128
"rollup": "^2.40.0",
130129
"rollup-plugin-istanbul": "^3.0.0",
131130
"rtlcss": "^3.1.2",

scss/_accordion.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
flex-shrink: 0;
3737
width: $accordion-icon-width;
3838
height: $accordion-icon-width;
39-
margin-left: auto;
39+
@include ltr-rtl("margin-left", auto);
4040
content: "";
4141
background-image: var(--#{$variable-prefix}accordion-button-icon, escape-svg($accordion-button-icon));
4242
background-repeat: no-repeat;

0 commit comments

Comments
 (0)