Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.html - github.com/twbs/bootstrap-npm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 163d369ac855ff33ace9d53ea5d178ab89ea1f30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<html>
  <head>
    <link rel="stylesheet" href="bootstrap-custom.css">
  </head>
  <body>
    <div class="p-3 p-md-5 text-white bg-primary">
      <div class="col-md-7 mx-auto py-md-5">
        <h1>Custom CSS with Bootstrap via npm</h1>
        <p>This demonstrates building a custom CSS file with Bootstrap's source Sass files, managed via npm. While not a complete solution, this demo highlights how to change default variables, create a custom stylesheet, and choose specific parts of CSS to include.</p>
        <p class="text-white-50">Note: This demo doesn't include compiling Bootstrap's JavaScript.</p>
      </div>
    </div>

    <div class="p-3 p-md-5 border-top border-bottom border-white">
      <div class="col-md-7 mx-auto">
        <h2>Included files</h2>
        <p>In addition to our <code>package.json</code> and some support files, this demo includes two key files:</p>
        <ul>
          <li><code>index.html</code> &mdash; the page you're looking at</li>
          <li><code>bootstrap-custom.scss</code> &mdash; a Sass stylesheet where we'll modify and compile our CSS</li>
        </ul>
        <p>Bootstrap's source Sass code is spread across dozens of smaller <code>.scss</code> files. By default, we include every one of these files in what we call our "import stack," a series of <code>@import</code> statements in the source <code>bootstrap.scss</code> files.</p>
        <p>To demonstrate how to optionally include Bootstrap piece-by-piece, the full Bootstrap import stack has been commented out in our <code>custom.scss</code> file, save for a handful of components:</p>
        <ul>
          <li><code>functions</code>, <code>variables</code>, and <code>mixins</code> &mdash; useful tools for interacting with and customizing Bootstrap's default styles.</li>
          <li><code>reboot</code> &mdash; our opinionated browser normalization styles.</li>
          <li><code>type</code> &mdash; our default typography styles.</li>
          <li><code>code</code> &mdash; our inline and block code styles.</li>
          <li><code>grid</code> &mdash; our layout and grid system styles.</li>
          <li><code>utilities</code> &mdash; all our utility classes for rapid prototyping.</li>
        </ul>
        <p>You may uncomment any of the additional imports, add new imports, or even write new styles.</p>

        <h2>Compiling</h2>
        <p>Built into npm is the ability to run scripts or tasks, like compiling CSS, via the command line. The <code>package.json</code> in any npm package typically includes scripts unique to that project. Here's how to use our this demo's npm scripts to compile a custom Bootstrap build.</p>
        <ol>
          <li>From the command line, navigate to this demo's root directory, <code>bootstrap-npm</code>.</li>
          <li>When ready, enter <code>npm start</code>. This will compile the CSS for the first time, and then watch the source <code>bootstrap-custom.scss</code> file for changes, automatically recompiling as necessary.</li>
          <li>Open the <code>index.html</code> file in any browser to see a styled page using your freshly compiled CSS.</li>
        </ol>
        <p>When using <code>npm start</code>, any changes you make to your <code>custom.scss</code> will automatically cause the Sass file to recompile. Refresh your HTML page to see those changes in action.</p>
        <p>Those just getting started with Bootstrap and npm may wish to build on this project's <code>package.json</code> by adding new dependencies and scripts. Please do!</p>
      </div>
    </div>

    <div class="p-3 p-md-5 border-bottom">
      <h2>Grid</h2>
      <p>Nothing special here, just container, row, and columns.</p>
      <div class="container-fluid">
        <div class="row">
          <div class="col-sm py-3 bg-light border">
            One of three columns
          </div>
          <div class="col-sm py-3 bg-light border">
            One of three columns
          </div>
          <div class="col-sm py-3 bg-light border">
            One of three columns
          </div>
        </div>
      </div>
    </div>

    <div class="p-5 border-bottom">
      <h2>Type</h2>
      <div class="row">
        <div class="col-md">
          <h3>Unordered list</h3>
          <ul>
            <li>Lorem ipsum dolor sit amet</li>
            <li>Consectetur adipiscing elit</li>
            <li>Integer molestie lorem at massa</li>
            <li>Facilisis in pretium nisl aliquet</li>
            <li>Nulla volutpat aliquam velit
              <ul>
                <li>Phasellus iaculis neque</li>
                <li>Purus sodales ultricies</li>
                <li>Vestibulum laoreet porttitor sem</li>
                <li>Ac tristique libero volutpat at</li>
              </ul>
            </li>
            <li>Faucibus porta lacus fringilla vel</li>
            <li>Aenean sit amet erat nunc</li>
            <li>Eget porttitor lorem</li>
          </ul>
        </div>
        <div class="col-md">
          <h3>Ordered list</h3>
          <ol>
            <li>Lorem ipsum dolor sit amet</li>
            <li>Consectetur adipiscing elit</li>
            <li>Integer molestie lorem at massa</li>
            <li>Facilisis in pretium nisl aliquet</li>
            <li>Nulla volutpat aliquam velit</li>
            <li>Faucibus porta lacus fringilla vel</li>
            <li>Aenean sit amet erat nunc</li>
            <li>Eget porttitor lorem</li>
          </ol>
        </div>
        <div class="col-md">
          <h3>Description list</h3>
          <dl>
            <dt>Description lists</dt>
            <dd>A description list is perfect for defining terms.</dd>
            <dt>Euismod</dt>
            <dd>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem.</dd>
            <dd>Donec id elit non mi porta gravida at eget metus.</dd>
            <dt>Malesuada porta</dt>
            <dd>Etiam porta sem malesuada magna mollis euismod.</dd>
          </dl>
        </div>
      </div>

      <h3>Tables</h3>
      <table>
        <caption>
          This is an example table, and this is its caption to describe the contents.
        </caption>
        <thead>
          <tr>
            <th>Table heading</th>
            <th>Table heading</th>
            <th>Table heading</th>
            <th>Table heading</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>Table cell</td>
            <td>Table cell</td>
            <td>Table cell</td>
            <td>Table cell</td>
          </tr>
          <tr>
            <td>Table cell</td>
            <td>Table cell</td>
            <td>Table cell</td>
            <td>Table cell</td>
          </tr>
          <tr>
            <td>Table cell</td>
            <td>Table cell</td>
            <td>Table cell</td>
            <td>Table cell</td>
          </tr>
        </tbody>
      </table>

      <h3>Code</h3>
    </div>

    <div class="p-5 border-bottom">
      <h2>Media</h2>

      <h3>Images</h3>

      <h3>Figures</h3>
    </div>

    <div class="p-5 border-bottom">
      <h2>Alert</h2>
      <div class="row">
        <div class="col-md-6">
          <div class="alert alert-primary" role="alert">
            A simple primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
          </div>
          <div class="alert alert-secondary" role="alert">
            A simple secondary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
          </div>
          <div class="alert alert-success" role="alert">
            A simple success alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
          </div>
          <div class="alert alert-danger" role="alert">
            A simple danger alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
          </div>
        </div>
        <div class="col-md-6">
          <div class="alert alert-warning" role="alert">
            A simple warning alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
          </div>
          <div class="alert alert-info" role="alert">
            A simple info alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
          </div>
          <div class="alert alert-light" role="alert">
            A simple light alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
          </div>
          <div class="alert alert-dark" role="alert">
            A simple dark alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
          </div>
        </div>
      </div>
    </div>

    <div class="p-5 border-bottom">
      <h2>Badge</h2>
      <div class="row">
        <div class="col-md-6">
          <div class="mb-3">
            <div class="h1">Example heading <span class="badge badge-secondary">New</span></div>
            <div class="h2">Example heading <span class="badge badge-secondary">New</span></div>
            <div class="h3">Example heading <span class="badge badge-secondary">New</span></div>
            <div class="h4">Example heading <span class="badge badge-secondary">New</span></div>
            <div class="h5">Example heading <span class="badge badge-secondary">New</span></div>
            <div class="h6">Example heading <span class="badge badge-secondary">New</span></div>
          </div>
        </div>
        <div class="col-md-6">
          <button type="button" class="btn btn-primary">
            Notifications <span class="badge badge-light">4</span>
          </button>
        </div>
      </div>
    </div>

    <div class="p-5 border-bottom">
      <h2>Breadcrumb</h2>
      <div class="row">
        <div class="col-md mb-3">
          <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
              <li class="breadcrumb-item active" aria-current="page">Home</li>
            </ol>
          </nav>
        </div>
        <div class="col-md mb-3">
          <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item active" aria-current="page">Library</li>
            </ol>
          </nav>
        </div>
        <div class="col-md mb-3">
          <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item"><a href="#">Library</a></li>
              <li class="breadcrumb-item active" aria-current="page">Data</li>
            </ol>
          </nav>
        </div>
      </div>
    </div>

    <div class="p-5 border-bottom">
      <h2>Buttons</h2>
      <div class="mb-3">
        <button type="button" class="btn btn-primary">Primary</button>
        <button type="button" class="btn btn-secondary">Secondary</button>
        <button type="button" class="btn btn-success">Success</button>
        <button type="button" class="btn btn-danger">Danger</button>
        <button type="button" class="btn btn-warning">Warning</button>
        <button type="button" class="btn btn-info">Info</button>
        <button type="button" class="btn btn-light">Light</button>
        <button type="button" class="btn btn-dark">Dark</button>
        <button type="button" class="btn btn-link">Link</button>
      </div>
      <div class="mb-3">
        <button type="button" class="btn btn-outline-primary">Primary</button>
        <button type="button" class="btn btn-outline-secondary">Secondary</button>
        <button type="button" class="btn btn-outline-success">Success</button>
        <button type="button" class="btn btn-outline-danger">Danger</button>
        <button type="button" class="btn btn-outline-warning">Warning</button>
        <button type="button" class="btn btn-outline-info">Info</button>
        <button type="button" class="btn btn-outline-light">Light</button>
        <button type="button" class="btn btn-outline-dark">Dark</button>
      </div>

      <div class="row">
        <div class="col-md mb-3">
          <div class="mb-3">
            <button type="button" class="btn btn-primary btn-lg btn-block">Block level button</button>
            <button type="button" class="btn btn-secondary btn-lg btn-block">Block level button</button>
          </div>
        </div>
        <div class="col-md mb-3">
          <div class="mb-3">
            <button type="button" class="btn btn-primary btn-lg">Large button</button>
            <button type="button" class="btn btn-secondary btn-lg">Large button</button>
          </div>
          <button type="button" class="btn btn-primary btn-sm">Small button</button>
          <button type="button" class="btn btn-secondary btn-sm">Small button</button>
        </div>
        <div class="col-md mb-3">
          <div class="btn-group" role="group" aria-label="Basic example">
            <button type="button" class="btn btn-secondary">Left</button>
            <button type="button" class="btn btn-secondary">Middle</button>
            <button type="button" class="btn btn-secondary">Right</button>
          </div>
        </div>
      </div>
    </div>

    <div class="p-5 border-bottom">
      <h2>Card</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Carousel</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Collapse</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Dropdown</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Forms</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Input group</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Jumbotron</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>List group</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Modal</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Navs</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Navbar</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Pagination</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Popover &amp; Tooltip</h2>
    </div>

    <div class="p-5 border-bottom">
      <h2>Progress</h2>
    </div>
  </body>
</html>