Bootstrap හි CSS තැනීමට භාවිතා කරන විචල්යයන්, මිශ්රණයන් සහ තවත් දේවලින් ප්රයෝජන ගැනීමට, CSS පූර්ව සකසනයක් වන LESS සමඟ Bootstrap අභිරුචිකරණය කර දිගු කරන්න .
Bootstrap සෑදී ඇත්තේ එහි හරය අඩුවෙන්, අපගේ හොඳ මිතුරා වන Alexis Sellier විසින් නිර්මාණය කරන ලද ගතික මෝස්තර පත්ර භාෂාවකි . එය පද්ධති මත පදනම් වූ CSS සංවර්ධනය වේගවත්, පහසු සහ වඩාත් විනෝදජනක කරයි.
CSS හි දිගුවක් ලෙස, LESS හි විචල්යයන්, නැවත භාවිත කළ හැකි කේත කොටස් සඳහා මිශ්රණයන්, සරල ගණිතය සඳහා මෙහෙයුම්, කැදැල්ල සහ වර්ණ ශ්රිත පවා ඇතුළත් වේ.
CSS හි වර්ණ සහ පික්සල් අගයන් කළමනාකරණය කිරීම තරමක් වේදනාවක් විය හැකිය, සාමාන්යයෙන් පිටපත් කිරීම සහ ඇලවීම පිරී ඇත. නමුත් අඩුවෙන් නොවේ - වර්ණ හෝ පික්සල් අගයන් විචල්ය ලෙස පවරන්න සහ ඒවා එක් වරක් වෙනස් කරන්න.
ඔබ සාමාන්ය ol' CSS හි සිදු කළ යුතු එම මායිම් අරය ප්රකාශ තුන? දැන් ඒවා ඔබට ඕනෑම තැනක නැවත භාවිත කළ හැකි මික්සින්, කේත කොටස්වල ආධාරයෙන් එක පේළියකට බැස ඇත.
මෙහෙයුම් සමඟ පියාසර කරමින් ගණිතය කිරීමෙන් ඔබේ ජාලකය, ප්රමුඛ, සහ වඩාත් නම්යශීලී කරන්න. 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 |
#c09853 | |
@warningBackground |
#f3edd2 | |
@errorText |
#b94a48 | |
@errorBackground |
#f2dede | |
@successText |
#468847 | |
@successBackground |
#dff0d8 | |
@infoText |
#3a87ad | |
@infoBackground |
#d9edf7 |
මූලික මික්සින් යනු CSS හි කොටසක් සඳහා අවශ්යයෙන්ම ඇතුළත් කිරීම හෝ අර්ධයකි. ඒවා ලියා ඇත්තේ CSS පන්තියක් මෙන් වන අතර ඕනෑම තැනක ඇමතීමට හැකිය.
- .මූලද්රව්යය {මූලද්රව්යය {
- . clearfix ();
- }
පරාමිතික මිශ්රණයක් මූලික මිශ්රණයක් වැනිය, නමුත් එය විකල්ප පෙරනිමි අගයන් සහිත පරාමිති (එබැවින් නම) ද පිළිගනී.
- .මූලද්රව්යය {මූලද්රව්යය {
- . මායිම - අරය ( 4px );
- }
Bootstrap හි mixins සියල්ලම පාහේ mixins.less තුළ ගබඩා කර ඇත, මෙවලම් කට්ටලයේ ඇති ඕනෑම .less ගොනුවක mixin භාවිතා කිරීමට ඔබට හැකියාව ලබා දෙන අපූරු උපයෝගිතා .less ගොනුවකි.
එබැවින්, ඉදිරියට ගොස් පවතින ඒවා භාවිතා කරන්න හෝ ඔබට අවශ්ය පරිදි ඔබේම දෑ එක් කිරීමට නිදහස් වන්න.
මික්සින් | පරාමිතීන් | භාවිතය |
---|---|---|
.clearfix() |
කිසිවක් නැත | ඇතුළත පාවෙන ඉවත් කිරීමට ඕනෑම මාපියෙකුට එක් කරන්න |
.tab-focus() |
කිසිවක් නැත | Webkit නාභිගත විලාසය සහ රවුම් Firefox දළ සටහන් යොදන්න |
.center-block() |
කිසිවක් නැත | භාවිතා කරන වාරණ මට්ටමේ මූලද්රව්යයක් ස්වයංක්රීයව මධ්යගත කරන්නmargin: auto |
.ie7-inline-block() |
කිසිවක් නැත | display: inline-block IE7 සහාය ලබා ගැනීමට සාමාන්යයට අමතරව භාවිතා කරන්න |
.size() |
@height: 5px, @width: 5px |
එක් පේළියක උස සහ පළල ඉක්මනින් සකසන්න |
.square() |
@size: 5px |
.size() පළල සහ උස එකම අගයක් ලෙස සැකසීමට ගොඩනැගේ |
.opacity() |
@opacity: 100 |
පාරාන්ධතා ප්රතිශතය පූර්ණ සංඛ්යා වලින් සකසන්න (උදා, "50" හෝ "75") |
මික්සින් | පරාමිතීන් | භාවිතය |
---|---|---|
.placeholder() |
@color: @placeholderText |
placeholder ආදාන සඳහා පෙළ වර්ණය සකසන්න |
මික්සින් | පරාමිතීන් | භාවිතය |
---|---|---|
#font > #family > .serif() |
කිසිවක් නැත | මූලද්රව්යයක් serif අකුරු තොගයක් භාවිතා කරන්න |
#font > #family > .sans-serif() |
කිසිවක් නැත | මූලද්රව්යයක් sans-serif අකුරු තොගයක් භාවිතා කරන්න |
#font > #family > .monospace() |
කිසිවක් නැත | මූලද්රව්යයක් මොනොස්පේස් අකුරු තොගයක් භාවිතා කරන්න |
#font > .shorthand() |
@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight |
අකුරු ප්රමාණය, බර සහ ප්රමුඛතාවය පහසුවෙන් සකසන්න |
#font > .serif() |
@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight |
අකුරු පවුල serif වෙත සකසන්න, සහ ප්රමාණය, බර සහ ප්රමුඛත්වය පාලනය කරන්න |
#font > .sans-serif() |
@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight |
අකුරු පවුල sans-serif වෙත සකසන්න, සහ ප්රමාණය, බර සහ ප්රමුඛත්වය පාලනය කරන්න |
#font > .monospace() |
@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight |
අකුරු පවුල මොනොස්පේස් වෙත සකසන්න, සහ ප්රමාණය, බර සහ ප්රමුඛ පාලනය කරන්න |
මික්සින් | පරාමිතීන් | භාවිතය |
---|---|---|
.container-fixed() |
කිසිවක් නැත | ඔබේ අන්තර්ගතය රඳවා තබා ගැනීම සඳහා තිරස් කේන්ද්රගත බහාලුමක් සාදන්න |
#grid > .core() |
@gridColumnWidth, @gridGutterWidth |
n තීරු සහ x පික්සල් පළල කාණු සහිත පික්සල් ජාල පද්ධතියක් (බහාලුම්, පේළි, සහ තීරු) ජනනය කරන්න |
#grid > .fluid() |
@fluidGridColumnWidth, @fluidGridGutterWidth |
n තීරු සහ x % පළල කාණු සහිත පූර්ව ජාල පද්ධතියක් ජනනය කරන්න |
මික්සින් | පරාමිතීන් | භාවිතය |
---|---|---|
.border-radius() |
@radius: 5px |
මූලද්රව්යයක කොන් වට කරන්න. තනි අගයක් හෝ අවකාශයෙන් වෙන් වූ අගයන් හතරක් විය හැක |
.box-shadow() |
@shadow: 0 1px 3px rgba(0,0,0,.25) |
මූලද්රව්යයකට බිංදු සෙවනැල්ලක් එක් කරන්න |
.transition() |
@transition |
CSS3 සංක්රාන්ති ආචරණය එක් කරන්න (උදා, all .2s linear ) |
.rotate() |
@degrees |
මූලද්රව්ය n අංශක කරකවන්න |
.scale() |
@ratio |
මූලද්රව්යයක් එහි මුල් ප්රමාණය මෙන් n ගුණයකට පරිමාණය කරන්න |
.translate() |
@x: 0, @y: 0 |
x සහ y තලවල මූලද්රව්යයක් ගෙන යන්න |
.background-clip() |
@clip |
Crop the background 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 |
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 |
Install the LESS command line compiler and uglify-js globally with npm by running the following command:
$ npm install -g less uglify-js
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).
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!
Download the latest Less.js and include the path to it (and Bootstrap) in the <head>
.
<link rel = "stylesheet/අඩු" 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.
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.
Crunch යනු Adobe Air මත ගොඩනගා ඇති විශිෂ්ට පෙනුමක් ඇති අඩු සංස්කාරකයක් සහ සම්පාදකයකි.
නිල නොවන Mac යෙදුම ලෙස එකම පුද්ගලයා විසින් නිර්මාණය කරන ලද, CodeKit යනු LESS, SASS, Stylus සහ CoffeeScript සම්පාදනය කරන Mac යෙදුමකි.
Mac, Linux, සහ PC යෙදුම අඩු ගොනු සම්පාදනය කිරීම සඳහා drag and drop. තවද, මූලාශ්ර කේතය GitHub මත ඇත.