Skip to content

Commit 1b4f6d8

Browse files
committed
docs: update content
1 parent 3ba5b31 commit 1b4f6d8

File tree

12 files changed

+94
-17
lines changed

12 files changed

+94
-17
lines changed

packages/docs/content/components/modal.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ return <CModal style={vars}>...</CModal>
10441044
10451045
<ScssDocs file="_variables.scss" capture="modal-variables"/>
10461046
1047-
### Sass loops
1047+
### SASS loops
10481048
10491049
[Responsive fullscreen modals](#fullscreen-modal) are generated via the `$breakpoints` map and a loop in `scss/_modal.scss`.
10501050

packages/docs/content/components/navbar.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ Variables for the [dark navbar](#color-schemes):
14481448

14491449
<ScssDocs file="_variables.scss" capture="navbar-dark-variables"/>
14501450

1451-
### Sass loops
1451+
### SASS loops
14521452

14531453
[Responsive navbar expand/collapse classes](#responsive-behaviors) (e.g., `.navbar-expand-lg`) are combined with the `$breakpoints` map and generated through a loop in `scss/_navbar.scss`.
14541454

packages/docs/content/forms/checkbox.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ Different variants of button, such at the various outlined styles, are supported
114114
<CFormCheck button={{ color: 'secondary', variant: 'outline' }} id="btn-check-2-outlined" autoComplete="off" label="Checked" defaultChecked/>
115115
```
116116

117+
## Customizing
118+
119+
### SASS variables
120+
121+
<ScssDocs file="_variables.scss" capture="form-check-variables" />
122+
117123
## API
118124

119125
### CFormCheck

packages/docs/content/forms/floating-labels.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ When working with the CoreUI for Bootstrap grid system, be sure to place form el
146146
</CRow>
147147
```
148148

149+
## Customizing
150+
151+
### SASS variables
152+
153+
<ScssDocs file="_variables.scss" capture="form-floating-variables" />
154+
149155
## API
150156

151157
### CFormFloating

packages/docs/content/forms/input-group.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ Input groups include support for custom selects and custom file inputs. Browser
339339
</CInputGroup>
340340
```
341341

342+
## Customizing
343+
344+
### SASS variables
345+
346+
<ScssDocs file="_variables.scss" capture="input-group-variables" />
347+
342348
## API
343349

344350
### CInputGroup

packages/docs/content/forms/input.mdx

+18
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,24 @@ If you want to have `<input readonly>` elements in your form styled as plain tex
155155
/>
156156
```
157157

158+
## Customizing
159+
160+
### SASS variables
161+
162+
`$input-*` are shared across most of our form controls (and not buttons).
163+
164+
<ScssDocs file="_variables.scss" capture="form-input-variables" />
165+
166+
`$form-label-*` and `$form-text-*` are for our `<CFormLabel />`s and `<CFormText />` component.
167+
168+
<ScssDocs file="_variables.scss" capture="form-label-variables" />
169+
170+
<ScssDocs file="_variables.scss" capture="form-text-variables" />
171+
172+
`$form-file-*` are for file input.
173+
174+
<ScssDocs file="_variables.scss" capture="form-file-variables" />
175+
158176
## API
159177

160178
### CFormInput

packages/docs/content/forms/radio.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ Different variants of button, such at the various outlined styles, are supported
9090
<CFormCheck button={{ color: 'danger', variant: 'outline' }} type="radio" name="options-outlined" id="danger-outlined" autoComplete="off" label="Radio"/>
9191
```
9292

93+
## Customizing
94+
95+
### SASS variables
96+
97+
<ScssDocs file="_variables.scss" capture="form-check-variables" />
98+
9399
## API
94100

95101
### CFormCheck

packages/docs/content/forms/range.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ By default, range inputs "snap" to integer values. To change this, you can speci
4141
<CFormRange min={0} max={5} step={0.5} label="Example range" defaultValue="3" id="customRange3" />
4242
```
4343

44+
## Customizing
45+
46+
### SASS variables
47+
48+
<ScssDocs file="_variables.scss" capture="form-range-variables" />
49+
4450
## API
4551

4652
### CFormRange

packages/docs/content/forms/select.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ Add the `disabled` boolean attribute on a select to give it a grayed out appeara
9696
</CFormSelect>
9797
```
9898

99+
## Customizing
100+
101+
### SASS variables
102+
103+
<ScssDocs file="_variables.scss" capture="form-select-variables" />
104+
99105
## API
100106

101107
### CFormSelect

packages/docs/content/forms/switch.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ Put your switches on the opposite side by adding `reverse` boolean property.
4646
<CFormSwitch reverse type="radio" id="reverseFormSwitch2" label="Disabled reverse switch" disabled/>
4747
```
4848

49+
## Customizing
50+
51+
### SASS variables
52+
53+
<ScssDocs file="_variables.scss" capture="form-switch-variables" />
54+
4955
## API
5056

5157
### CFormSwitch

packages/docs/content/forms/textarea.mdx

+14
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ Add the `readOnly` boolean attribute on an textarea to prevent modification of t
6666
></CFormTextarea>
6767
```
6868

69+
## Customizing
70+
71+
### SASS variables
72+
73+
`$input-*` are shared across most of our form controls (and not buttons).
74+
75+
<ScssDocs file="_variables.scss" capture="form-input-variables" />
76+
77+
`$form-label-*` and `$form-text-*` are for our `<CFormLabel />`s and `<CFormText />` component.
78+
79+
<ScssDocs file="_variables.scss" capture="form-label-variables" />
80+
81+
<ScssDocs file="_variables.scss" capture="form-text-variables" />
82+
6983
## API
7084

7185
### CFormTextarea

packages/docs/content/forms/validation.mdx

+18-15
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ import {
3030
CRow,
3131
} from '@coreui/react/src/index'
3232

33-
{/* ## How it works
34-
35-
Here's how form validation works with Bootstrap:
36-
37-
- HTML form validation is applied via CSS's two pseudo-classes, `:invalid` and `:valid`. It applies to `<input>`, `<select>`, and `<textarea>` elements.
38-
- CoreUI for Bootstrap scopes the `:invalid` and `:valid` styles to parent `.was-validated` class, usually applied to the `<form>`. Otherwise, any required field without a value shows up as invalid on page load. This way, you may choose when to activate them (typically after form submission is attempted).
39-
- To reset the appearance of the form (for instance, in the case of dynamic form submissions using AJAX), remove the `.was-validated` class from the `<form>` again after submission.
40-
- As a fallback, `.is-invalid` and `.is-valid` classes may be used instead of the pseudo-classes for [server-side validation](#server-side). They do not require a `.was-validated` parent class.
41-
- Due to constraints in how CSS works, we cannot (at present) apply styles to a `<label>` that comes before a form control in the DOM without the help of custom JavaScript.
42-
- All modern browsers support the [constraint validation API](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#the-constraint-validation-api), a series of JavaScript methods for validating form controls.
43-
- Feedback messages may utilize the [browser defaults](#browser-defaults) (different for each browser, and unstylable via CSS) or our custom feedback styles with additional HTML and CSS.
44-
- You may provide custom validity messages with `setCustomValidity` in JavaScript.
45-
46-
With that in mind, consider the following demos for our custom form validation styles, optional server-side classes, and browser defaults.*/}
47-
4833
## Example
4934

5035
For custom CoreUI form validation messages, you'll need to add the `noValidate` boolean property to your `<CForm>`. This disables the browser default feedback tooltips, but still provides access to the form validation APIs in JavaScript. Try to submit the form below; our JavaScript will intercept the submit button and relay feedback to you. When attempting to submit, you'll see the `:invalid` and `:valid` styles applied to your form controls.
@@ -692,3 +677,21 @@ return (
692677
</CForm>
693678
)
694679
```
680+
681+
## Customizing
682+
683+
### CSS variables
684+
685+
CoreUI for React components use local CSS variables for validation for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
686+
687+
<ScssDocs file="_root.scss" capture="root-form-validation-variables"/>
688+
689+
These variables are also color mode adaptive, meaning they change color while in dark mode.
690+
691+
### SASS variables
692+
693+
<ScssDocs file="_variables.scss" capture="form-feedback-variables" />
694+
695+
<ScssDocs file="_variables.scss" capture="form-validation-colors" />
696+
697+
<ScssDocs file="_variables-dark.scss" capture="form-validation-colors-dark" />

0 commit comments

Comments
 (0)