bootstrap: update

This commit is contained in:
Rico Sta. Cruz 2017-09-04 09:29:00 +08:00
parent b342002a7b
commit dd9f82752d
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 113 additions and 71 deletions

View File

@ -1,111 +1,153 @@
--- ---
title: Bootstrap title: Bootstrap
layout: 2017/sheet
prism_languages: [scss, haml, html]
weight: -1
--- ---
### Screen sizes ### Screen sizes
768 992 1200 ```
' ' ' ' ' ' ' ' ' 768 992 1200
<---------^------------^------------------^---------> ' ' ' ' ' ' ' ' '
xs sm md lg <---------^------------^------------------^--------->
(phone) (tablet) (laptop) (desktop) xs sm md lg
(phone) (tablet) (laptop) (desktop)
```
Min: Min:
@media (min-width: @screen-sm-min) { // >= 768px (small tablet) ```scss
@media (min-width: @screen-md-min) { // >= 992px (medium laptop) @media (min-width: @screen-sm-min) // >= 768px (small tablet)
@media (min-width: @screen-lg-min) { // >= 1200px (large desktop) @media (min-width: @screen-md-min) // >= 992px (medium laptop)
@media (min-width: @screen-lg-min) // >= 1200px (large desktop)
```
Max: Max:
@media (max-width: @screen-xs-max) { // < 768px (xsmall phone) ```scss
@media (max-width: @screen-sm-max) { // < 992px (small tablet) @media (max-width: @screen-xs-max) { // < 768px (xsmall phone)
@media (max-width: @screen-md-max) { // < 1200px (medium laptop) @media (max-width: @screen-sm-max) { // < 992px (small tablet)
@media (max-width: @screen-md-max) { // < 1200px (medium laptop)
```
### Columns ### Columns
.container ```scss
.container-fluid .container
.container-fluid
```
.col-xs-1 ```scss
.col-sm-1 .col-xs-1
.col-md-1 .col-sm-1
.col-lg-1 .col-md-1
.col-md-offset-1 .col-lg-1
.col-md-offset-1
```
.make-xs-column(12) Mixins:
.make-sm-column(6)
.make-md-column(3)
.make-lg-column(3)
.make-sm-column-offset(1) ```scss
.make-sm-column-push(1) @include make-xs-column(12);
.make-sm-column-pull(1) @include make-sm-column(6);
@include make-md-column(3);
@include make-lg-column(3);
```
```scss
@include make-sm-column-offset(1);
@include make-sm-column-push(1);
@include make-sm-column-pull(1);
```
### Utilities ### Utilities
.pull-left ```scss
.pull-right .pull-left
.pull-right
```
.hidden-{xs,sm,md,lg} ```scss
.visible-{xs,sm,md,lg} .hidden-{xs,sm,md,lg}
.visible-{xs,sm,md,lg,print}-{block,inline,inline-block} .visible-{xs,sm,md,lg}
.visible-{xs,sm,md,lg,print}-{block,inline,inline-block}
```
.center-block /* margin: auto */ ```scss
.clearfix .center-block /* margin: auto */
.text-{center,left,right,justify,nowrap} .clearfix
.text-{lowercase,uppercase,capitalize} .text-{center,left,right,justify,nowrap}
.text-{lowercase,uppercase,capitalize}
```
.show ```scss
.hidden .show
.hidden
```
### Modal ### Modal
<a data-toggle='modal' data-target='#new'> ```html
<a data-toggle='modal' data-target='#new'>
```
#new.modal.fade(role='dialog') ```haml
.modal-dialog // .modal-lg, .modal-sm #new.modal.fade(role='dialog')
.modal-content .modal-dialog // .modal-lg, .modal-sm
.modal-header .modal-content
%h4.modal-title hello .modal-header
%button.close{type: 'button', data: { dismiss: 'modal' }} %h4.modal-title hello
%span{'aria-hidden' => true}!= "&times;" %button.close{type: 'button', data: { dismiss: 'modal' }}
%span.sr-only Close %span{'aria-hidden' => true}!= "&times;"
.modal-body %span.sr-only Close
... .modal-body
.modal-footer ...
... .modal-footer
...
```
### Modal via ajax (Rails) ### Modal via ajax (Rails)
%button.btn{data: { | ```haml
toggle: 'modal', | %button.btn{data: { |
target: '#chooseTheme', | toggle: 'modal', |
remote: '/path/to/remote'} target: '#chooseTheme', |
Change Theme remote: '/path/to/remote'}
Change Theme
```
.modal.fade#chooseTheme ```haml
.modal-dialog.modal-xl .modal.fade#chooseTheme
.modal-content .modal-dialog.modal-xl
.modal-header .modal-content
%h4.modal-title Choose a theme .modal-header
%h4.modal-title Choose a theme
.modal-body .modal-body
.spinner-panel.-lg .spinner-panel.-lg
%i %i
```
### Tooltip ### Tooltip
data-toggle='tooltip' ```html
title='tooltip' <span
data-placement='left|top|bottom|right' data-toggle='tooltip'
title='tooltip'
data-placement='left|top|bottom|right'>
```
$(function () { ```js
$('[data-toogle~="tooltip"]').tooltip(); $(function () {
}); $('[data-toogle~="tooltip"]').tooltip()
})
```
### Input groups ### Input groups
.input-group ```haml
input.form-control(type='text') .input-group
.input-group-addon years input.form-control(type='text')
.input-group-addon years
```