ବୁଟଷ୍ଟ୍ରାପ୍ ସହିତ LESS ବ୍ୟବହାର କରିବା |

ବୁଟଷ୍ଟ୍ରାପ୍ ର CSS ନିର୍ମାଣ ପାଇଁ ଭେରିଏବଲ୍, ମିକ୍ସିନ୍ ଏବଂ ଅଧିକ ବ୍ୟବହାର କରାଯାଉଥିବା LESS , CSS ପ୍ରିପ୍ରୋସେସର୍ ସହିତ ବୁଟଷ୍ଟ୍ରାପ୍ କଷ୍ଟୋମାଇଜ୍ ଏବଂ ବିସ୍ତାର କର |

କାହିଁକି କମ?

ବୁଟ୍ ଷ୍ଟ୍ରାପ୍ ଏହାର ମୂଳରେ LESS ସହିତ ତିଆରି ହୋଇଛି, ଆମର ଭଲ ବନ୍ଧୁ ଆଲେକ୍ସସ୍ ସେଲିଅର୍ ଦ୍ୱାରା ନିର୍ମିତ ଏକ ଗତିଶୀଳ ଷ୍ଟାଇଲ୍ ଶୀଟ୍ ଭାଷା | ଏହା ସିଷ୍ଟମ-ଆଧାରିତ CSS କୁ ଶୀଘ୍ର, ସହଜ ଏବଂ ଅଧିକ ମଜାଳିଆ କରିଥାଏ |

କ’ଣ ଅନ୍ତର୍ଭୂକ୍ତ କରାଯାଇଛି?

CSS ର ଏକ ବିସ୍ତାର ଭାବରେ, LESS ରେ ଭେରିଏବଲ୍, କୋଡ୍ ର ପୁନ us ବ୍ୟବହାର ଯୋଗ୍ୟ ସ୍ନିପେଟ୍ ପାଇଁ ମିକ୍ସନ୍ସ, ସରଳ ଗଣିତ ପାଇଁ କାର୍ଯ୍ୟ, ବସା, ଏବଂ ରଙ୍ଗ କାର୍ଯ୍ୟ ମଧ୍ୟ ଅନ୍ତର୍ଭୁକ୍ତ |

ଅଧିକ ସିଖନ୍ତୁ

କମ CSS |

ଅଧିକ ଜାଣିବା ପାଇଁ http://lesscss.org/ ରେ ଅଫିସିଆଲ୍ ୱେବସାଇଟ୍ ପରିଦର୍ଶନ କରନ୍ତୁ |

ଭେରିଏବଲ୍ |

CSS ରେ ରଙ୍ଗ ଏବଂ ପିକ୍ସେଲ ମୂଲ୍ୟ ପରିଚାଳନା କରିବା ଟିକିଏ ଯନ୍ତ୍ରଣା ହୋଇପାରେ, ସାଧାରଣତ copy କପି ଏବଂ ପେଷ୍ଟରେ ପରିପୂର୍ଣ୍ଣ | ଯଦିଓ LESS ସହିତ ନୁହେଁ - ରଙ୍ଗ କିମ୍ବା ପିକ୍ସେଲ ମୂଲ୍ୟକୁ ଭେରିଏବଲ୍ ଭାବରେ ନ୍ୟସ୍ତ କରନ୍ତୁ ଏବଂ ଥରେ ପରିବର୍ତ୍ତନ କରନ୍ତୁ |

ମିକ୍ସନ୍ସ |

ସେହି ତିନୋଟି ସୀମା-ରେଡିଓ ଘୋଷଣା ତୁମେ ନିୟମିତ ol 'CSS ରେ କରିବା ଆବଶ୍ୟକ? ବର୍ତ୍ତମାନ ସେମାନେ ମିଶ୍ରଣ, କୋଡ୍ ର ସ୍ନିପେଟ୍ ସାହାଯ୍ୟରେ ଗୋଟିଏ ଧାଡିରେ ଅଛନ୍ତି ଯାହାକୁ ଆପଣ ଯେକ anywhere ଣସି ସ୍ଥାନରେ ପୁନ use ବ୍ୟବହାର କରିପାରିବେ |

ଅପରେସନ୍ସ

ଅପରେସନ୍ ସହିତ ଫ୍ଲାଇରେ ଗଣିତ କରି ଆପଣଙ୍କର ଗ୍ରୀଡ୍, ଅଗ୍ରଣୀ ଏବଂ ଅଧିକ ସୁପର ଫ୍ଲେକ୍ସିବଲ୍ କରନ୍ତୁ | ଏକାଧିକ, ବିଭାଜନ, ଯୋଡ, ଏବଂ CSS ପରିମଳ ପାଇଁ ତୁମର ଉପାୟ ବାହାର କର |

ହାଇପରଲିଙ୍କ୍

@linkColor # 08c ଡିଫଲ୍ଟ ଲିଙ୍କ୍ ପାଠ୍ୟ ରଙ୍ଗ |
@linkColorHover darken(@linkColor, 15%) ଡିଫଲ୍ଟ ଲିଙ୍କ୍ ଟେକ୍ସଟ୍ ହୋଭର ରଙ୍ଗ |

ଗ୍ରୀଡ୍ ସିଷ୍ଟମ୍ |

@gridColumns 12
@gridColumnWidth 60px
@gridGutterWidth 20px
@fluidGridColumnWidth 6.382978723%
@fluidGridGutterWidth 2.127659574%

ଟାଇପୋଗ୍ରାଫି |

@baseFontSize 13px
@baseFontFamily "Helvetica Neue", Helvetica, Arial, sans-serif
@baseLineHeight 18px

ଗ୍ରେସ୍କେଲ୍ ରଙ୍ଗ |

@black # 000
@grayDarker # 222
@grayDark # 333
@gray # 555
@grayLight # 999
@grayLighter #eee
@white #fff

ଉଚ୍ଚାରଣ ରଙ୍ଗ |

@blue # 049cdb
@green # 46a546
@red # 9d261d
@yellow # ffc40d
@orange # f89406
@pink # c3325f
@purple # 7a43b6

ଉପାଦାନଗୁଡ଼ିକ |

ବଟନ୍

@primaryButtonBackground @linkColor

ଫର୍ମଗୁଡିକ

@placeholderText @grayLight

ନାଭବାର୍ |

@navbarHeight 40px
@navbarBackground @grayDarker
@navbarBackgroundHighlight @grayDark
@navbarText @grayLight
@navbarLinkColor @grayLight
@navbarLinkColorHover @white

ଫର୍ମ ଷ୍ଟେଟସ୍ ଏବଂ ଆଲର୍ଟ |

@warningText # f3edd2
@warningBackground # c09853
@errorText # b94a48
@errorBackground # f2dede
@successText # 468847
@successBackground # dff0d8
@infoText # 3a87ad
@infoBackground # d9edf7

ମିଶ୍ରଣ ବିଷୟରେ |

ମ Basic ଳିକ ମିଶ୍ରଣ |

ଏକ ମ basic ଳିକ ମିଶ୍ରଣ ହେଉଛି CSS ର ଏକ ସ୍ନିପେଟ୍ ପାଇଁ ଏକ ଅନ୍ତର୍ଭୂକ୍ତ କିମ୍ବା ଆଂଶିକ | ସେଗୁଡିକ ଏକ CSS ଶ୍ରେଣୀ ପରି ଲେଖା ହୋଇଛି ଏବଂ ଯେକ anywhere ଣସି ସ୍ଥାନକୁ ଡକାଯାଇପାରିବ |

  1. .element {element {
  2. .clearfix();
  3. }

ପାରାମେଟ୍ରିକ୍ ମିଶ୍ରଣ |

ଏକ ପାରାମେଟ୍ରିକ୍ ମିକ୍ସିନ୍ ଏକ ମ basic ଳିକ ମିଶ୍ରଣ ପରି, କିନ୍ତୁ ଏହା ଇଚ୍ଛାଧୀନ ଡିଫଲ୍ଟ ମୂଲ୍ୟ ସହିତ ପାରାମିଟରଗୁଡିକ (ତେଣୁ ନାମ) ମଧ୍ୟ ଗ୍ରହଣ କରେ |

  1. .element {element {
  2. .border-radius(4px);
  3. }

ସହଜରେ ଆପଣଙ୍କର ନିଜର ଯୋଗ କରନ୍ତୁ |

ପ୍ରାୟ ସମସ୍ତ ବୁଟଷ୍ଟ୍ରାପ୍ ର ମିଶ୍ରଣଗୁଡିକ mixins.less ରେ ଗଚ୍ଛିତ ହୋଇଛି, ଏକ ଚମତ୍କାର ଉପଯୋଗୀତା।

ତେଣୁ, ଆଗକୁ ବ and ନ୍ତୁ ଏବଂ ବିଦ୍ୟମାନଗୁଡିକ ବ୍ୟବହାର କରନ୍ତୁ କିମ୍ବା ଆପଣ ଆବଶ୍ୟକ ଅନୁଯାୟୀ ନିଜର ଯୋଗ କରିବାକୁ ମୁକ୍ତ ମନ ଦିଅନ୍ତୁ |

Included mixins

Utilities

Mixin Parameters Usage
.clearfix() none Add to any parent to clear floats within
.tab-focus() none Apply the Webkit focus style and round Firefox outline
.center-block() none Auto center a block-level element using margin: auto
.ie7-inline-block() none Use in addition to regular display: inline-block to get IE7 support
.size() @height: 5px, @width: 5px Quickly set the height and width on one line
.square() @size: 5px Builds on .size() to set the width and height as same value
.opacity() @opacity: 100 Set, in whole numbers, the opacity percentage (e.g., "50" or "75")

Forms

Mixin Parameters Usage
.placeholder() @color: @placeholderText Set the placeholder text color for inputs

Typography

Mixin Parameters Usage
#font > #family > .serif() none Make an element use a serif font stack
#font > #family > .sans-serif() none Make an element use a sans-serif font stack
#font > #family > .monospace() none Make an element use a monospace font stack
#font > .shorthand() @size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight Easily set font size, weight, and leading
#font > .serif() @size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight Set font family to serif, and control size, weight, and leading
#font > .sans-serif() @size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight Set font family to sans-serif, and control size, weight, and leading
#font > .monospace() @size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight Set font family to monospace, and control size, weight, and leading

Grid system

Mixin Parameters Usage
.container-fixed() none Provide a fixed-width (set with @siteWidth) container for holding your content
.columns() @columns: 1 Build a grid column that spans any number of columns (defaults to 1 column)
.offset() @columns: 1 Offset a grid column with left margin that spans any number of columns
.gridColumn() none Make an element float like a grid column

CSS3 properties

Mixin Parameters Usage
.border-radius() @radius: 5px Round the corners of an element. Can be a single value or four space-separated values
.box-shadow() @shadow: 0 1px 3px rgba(0,0,0,.25) Add a drop shadow to an element
.transition() @transition Add CSS3 transition effect (e.g., all .2s linear)
.rotate() @degrees Rotate an element n degrees
.scale() @ratio Scale an element to n times it's original size
.translate() @x: 0, @y: 0 Move an element on the x and y planes
.background-clip() @clip Crop the backgroud of an element (useful for border-radius)
.background-size() @size Control the size of background images via CSS3
.box-sizing() @boxmodel Change the box model for an element (e.g., border-box for a full-width input)
.user-select() @select Control cursor selection of text on a page
.resizable() @direction: both Make any element resizable on the right and bottom
.content-columns() @columnCount, @columnGap: @gridColumnGutter Make the content of any element use CSS3 columns

Backgrounds and gradients

Mixin Parameters Usage
.#translucent > .background() @color: @white, @alpha: 1 Give an element a translucent background color
.#translucent > .border() @color: @white, @alpha: 1 Give an element a translucent border color
.#gradient > .vertical() @startColor, @endColor Create a cross-browser vertical background gradient
.#gradient > .horizontal() @startColor, @endColor Create a cross-browser horizontal background gradient
.#gradient > .directional() @startColor, @endColor, @deg Create a cross-browser directional background gradient
.#gradient > .vertical-three-colors() @startColor, @midColor, @colorStop, @endColor Create a cross-browser three-color background gradient
.#gradient > .radial() @innerColor, @outerColor Create a cross-browser radial background gradient
.#gradient > .striped() @color, @angle Create a cross-browser striped background gradient
.#gradientBar() @primaryColor, @secondaryColor Used for buttons to assign a gradient and slightly darker border
Note: If you're submitting a pull request to GitHub with modified CSS, you must recompile the CSS via any of these methods.

Tools for compiling

Node with makefile

Install the LESS command line compiler with npm by running the following command:

$ npm install less

Once installed just run make from the root of your bootstrap directory and you're all set.

Additionally, if you have watchr installed, you may run make watch to have bootstrap automatically rebuilt every time you edit a file in the bootstrap lib (this isn't required, just a convenience method).

Command line

Install the LESS command line tool via Node and run the following command:

$ lessc ./lib/bootstrap.less > bootstrap.css

Be sure to include --compress in that command if you're trying to save some bytes!

Javascript

Download the latest Less.js and include the path to it (and Bootstrap) in the <head>.

<link rel="stylesheet/less" href="/path/to/bootstrap.less">
<script src="/path/to/less.js"></script>

To recompile the .less files, just save them and reload your page. Less.js compiles them and stores them in local storage.

Unofficial Mac app

The unofficial Mac app watches directories of .less files and compiles the code to local files after every save of a watched .less file.

If you like, you can toggle preferences in the app for automatic minifying and which directory the compiled files end up in.

More Mac apps

Crunch

କ୍ରଞ୍ଚ ହେଉଛି ଆଡୋବ ଏୟାରରେ ନିର୍ମିତ ଏକ ସୁନ୍ଦର ଦେଖାଯାଉଥିବା LESS ଏଡିଟର୍ ଏବଂ କମ୍ପାଇଲର୍ |

CodeKit

ଅଣଅନୁଷ୍ଠାନିକ ମ୍ୟାକ୍ ଆପ୍ ସହିତ ସମାନ ବ୍ୟକ୍ତିଙ୍କ ଦ୍ ated ାରା ସୃଷ୍ଟି, କୋଡକିଟ୍ ହେଉଛି ଏକ ମ୍ୟାକ୍ ଆପ୍ ଯାହା LESS, SASS, Stylus, ଏବଂ CoffeeScript ସଂକଳନ କରେ |

ସରଳ

LESS ଫାଇଲଗୁଡିକର ଡ୍ରାଗ୍ ଏବଂ ଡ୍ରପ୍ ସଙ୍କଳନ ପାଇଁ ମ୍ୟାକ୍, ଲିନକ୍ସ, ଏବଂ PC ଆପ୍ | ଏହା ସହିତ, ଉତ୍ସ କୋଡ୍ GitHub ରେ ଅଛି |