Ignore:
Timestamp:
Nov 11, 2017 1:12:58 PM (7 years ago)
Author:
anonymous
Message:

Convert font-size percentages to rem. Fix form input widths and padding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/css/utilities.inc.css

    r559 r616  
    1010/*_____________________ FORMS ____________________*/
    1111
     12input.sc-micro, textarea.sc-micro, select.sc-micro,
    1213input.sc-tiny, textarea.sc-tiny, select.sc-tiny,
    1314input.sc-small, textarea.sc-small, select.sc-small,
     
    1617input.sc-full, textarea.sc-full, select.sc-full {
    1718    margin: 0 0.5rem 0 0;
    18     padding: 3px 0.25rem;
     19    padding: 2px 0.25rem;
    1920    border-width: 1px;
     21    box-sizing: border-box;
    2022}
    2123
    2224/*
    23 The following widths are calculated using `width = (maxwidth - (1.2 * multiple)) / multiple`
     25The following widths are calculated to include a small right-margin and be equally divisible so the right edges align.
     26The formula is `width = (maxwidth - (rightmargin * multiple)) / multiple`
    2427where width is the sought value, maxwidth is the width of a sc-large, and multiple is the number
    25 of times an element fits within maxwidth (i.e. sc-tiny has a multiple of 8).
     28of times an element fits within maxwidth (i.e. sc-micro has a multiple of 16).
    2629The values are dependent on the margin, padding, and border set above.
     30(44-(0.5*1))/1 = 43.5
     31(44-(0.5*2))/2 = 21.5
     32(44-(0.5*4))/4 = 10.5
     33(44-(0.5*8))/8 = 5
     34(44-(0.5*8))/16 = 2.5
     35Note: avoid adding whitespace between input elements, or add `display: flex;` to the inputs' parent.
    2736*/
    28 input.sc-micro, textarea.sc-micro, select.sc-micro, label.sc-micro      { width: 1.55rem; }
    29 input.sc-tiny, textarea.sc-tiny, select.sc-tiny, label.sc-tiny          { width: 4.54rem; }
    30 input.sc-small, textarea.sc-small, select.sc-small, label.sc-small      { width: 10.15rem; }
    31 input.sc-medium, textarea.sc-medium, select.sc-medium, label.sc-medium  { width: 21.42rem; }
    32 input.sc-large, textarea.sc-large, select.sc-large, label.sc-large      { width: 44rem; }
     37input.sc-micro, textarea.sc-micro, select.sc-micro, label.sc-micro      { width: 2.5rem; }
     38input.sc-tiny, textarea.sc-tiny, select.sc-tiny, label.sc-tiny          { width: 5rem; }
     39input.sc-small, textarea.sc-small, select.sc-small, label.sc-small      { width: 10.5rem; }
     40input.sc-medium, textarea.sc-medium, select.sc-medium, label.sc-medium  { width: 21.5rem; }
     41input.sc-large, textarea.sc-large, select.sc-large, label.sc-large      { width: 43.5rem; }
    3342input.sc-full, textarea.sc-full, select.sc-full, label.sc-full          { width: 100%; }
    3443
Note: See TracChangeset for help on using the changeset viewer.