Guest User

Untitled

a guest
Dec 22nd, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. /**
  2. * Use em or rem font-size in Bootstrap 3
  3. */
  4.  
  5. @font-size-root: 14px;
  6. @font-unit: 0rem; // Pick em or rem here
  7.  
  8.  
  9. // Convert all variables to em
  10.  
  11. @font-size-base: 1 + @font-unit;
  12. @font-size-large: 1.25 + @font-unit;
  13. @font-size-small: 0.85 + @font-unit;
  14.  
  15. @font-size-h1: 2.6 + @font-unit;
  16. @font-size-h2: 2.15 + @font-unit;
  17. @font-size-h3: 1.7 + @font-unit;
  18. @font-size-h4: 1.25 + @font-unit;
  19. @font-size-h5: @font-size-base;
  20. @font-size-h6: 0.85 + @font-unit;
  21.  
  22. @line-height-computed: (@font-size-base * @line-height-base);
  23.  
  24. @padding-base-vertical: ((6px / @font-size-root) + @font-unit);
  25. @padding-base-horizontal: ((12px / @font-size-root) + @font-unit);
  26.  
  27. @padding-large-vertical: ((10px / @font-size-root) + @font-unit);
  28. @padding-large-horizontal: ((16px / @font-size-root) + @font-unit);
  29.  
  30. @padding-small-vertical: ((5px / @font-size-root) + @font-unit);
  31. @padding-small-horizontal: ((10px / @font-size-root) + @font-unit);
  32.  
  33. @padding-xs-vertical: ((1px / @font-size-root) + @font-unit);
  34. @padding-xs-horizontal: ((5px / @font-size-root) + @font-unit);
  35.  
  36. @border-radius-base: ((4px / @font-size-root) + @font-unit);
  37. @border-radius-large: ((6px / @font-size-root) + @font-unit);
  38. @border-radius-small: ((3px / @font-size-root) + @font-unit);
  39.  
  40. @caret-width-base: ((4px / @font-size-root) + @font-unit);
  41. @caret-width-large: ((5px / @font-size-root) + @font-unit);
  42.  
  43. //** Default `.form-control` height
  44. @input-height-base: (@line-height-computed + (@padding-base-vertical * 2));
  45. //** Large `.form-control` height
  46. @input-height-large: ((@font-size-large * @line-height-large) + (@padding-large-vertical * 2));
  47. //** Small `.form-control` height
  48. @input-height-small: ((@font-size-small * @line-height-small) + (@padding-small-vertical * 2));
  49.  
  50.  
  51. // Set root font size
  52.  
  53. html {
  54. font-size: @font-size-root;
  55. }
  56.  
  57.  
  58. // Change styling for elements that mix pixels and ems
  59.  
  60. pre {
  61. font-size: ( @font-size-base - (1 / @font-size-root) );
  62. }
  63.  
  64. .form-control-feedback {
  65. width: calc(@input-height-base ~" + 2px");
  66. height: calc(@input-height-base ~" + 2px");
  67. }
  68. .input-lg + .form-control-feedback {
  69. width: calc(@input-height-large ~" + 2px");
  70. height: calc(@input-height-large ~" + 2px");
  71. }
  72. .input-sm + .form-control-feedback {
  73. width: calc(@input-height-small ~" + 2px");
  74. height: calc(@input-height-small ~" + 2px");
  75. }
  76.  
  77. .form-control {
  78. height: calc(@input-height-base ~" + 2px");
  79. }
  80.  
  81. .form-horizontal {
  82. .radio, .checkbox, .radio-inline, .checkbox-inline {
  83. padding: @padding-base-vertical;
  84. border: 1px solid transparent;
  85. }
  86. .radio, .checkbox {
  87. min-height: calc((@line-height-computed + @padding-base-vertical) ~"+ 1px");
  88. }
  89. .form-control-static {
  90. padding-top: @padding-base-vertical;
  91. border-top: 1px solid transparent;
  92. padding-bottom: @padding-base-vertical;
  93. border-bottom: 1px solid transparent;
  94. }
  95.  
  96. @media (min-width: @screen-sm-min) {
  97. .control-label {
  98. padding-top: @padding-base-vertical;
  99. border-top: 1px solid transparent;
  100. }
  101. }
  102. }
Add Comment
Please, Sign In to add comment