Grid

ParaGRIDma uses a very standard method to display grid (very similar to popular frameworks like bootstrap or foundation). It has some basic rules

  • The grid system is based on a 12 column layout, with a max-width defined on CSS (@row-max-width)
  • All the rows must be wrapped in a a container with the class container
  • All the columns in a row must be wrapper in a container with the class row
  • Each column must have a class from g-1 to g-12 depending of the desired with
column g-12
column g-11
1
column g-10
column g-2
column g-9
column g-3
column g-8
column g-4
column g-7
column g-5
column g-6
column g-6
column g-5
column g-7
column g-4
column g-8
column g-3
column g-9
column g-2
column g-10
10
column g-11

Centered columns

If you want to center a column you must add the class centered to the column. You can also add class ac to center text inside the column.

Content of column column g-8 centered
Content of column column g-6 centered
Content of column column g-4 centered
Content of column column g-2 centered

Columns with no padding

If we add the class np to the columns we can remove its padding.

no padding
column with no padding with the class np

Nested columns

The grid allows for nesting down. You can create complex layouts using nesting columns

column g-4
column g-8
column g-4
column g-8

Columns like there is no tomorrow

If you want to add a lot of columns, but you don't want to create a row element for each line you can simply add a class first to the column in which you want to start a new row.

Column
Column
Column
Start new row
Column
Column
Start new row
Column
Column

Split Columns on big mobiles

Sometimes we want to reduce the amount of columns in small screens, but don't want to show them 100% width. In those cases we can add the class split-on-mobile on the row element.

  • This change take effect between size of @screen-smal and @screen-medium
  • To test it reduce the size of the browser. You will see that the following 4 columns will be shown in groups of 2.
Four columns that are shown in groups of two on big mobiles.
Four columns that are shown in groups of two on big mobiles.
Four columns that are shown in groups of two on big mobiles.
Four columns that are shown in groups of two on big mobiles.
Two columns that are shown in groups of two on big mobiles.
Two columns that are shown in groups of two on big mobiles.

Split Columns even on small mobiles

Sometimes we want to reduce the amount of columns in small screens, but don't want to show them 100% width. In those cases we can add the class split-on-mobile on the row element.

  • This change take effect between size of @screen-smal and @screen-medium
  • To test it reduce the size of the browser. You will see that the following 4 columns will be shown in groups of 2.
Four columns that are shown in groups of two on big mobiles.
Four columns that are shown in groups of two on big mobiles.
Four columns that are shown in groups of two on big mobiles.
Four columns that are shown in groups of two on big mobiles.

Fixed Block (always)

Those panels have two columns. One of them has a fixed width, and the other one is fluid.

Frameworks defualt values: 50px, 100px, 150px, 200px and 250px. You can create new sizes editing the css file. Look for the classes .pf

FLUID COLUMN

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus, ac egestas augue laoreet a. Quisque varius ligula non est porta sit amet dictum orci consequat. Morbi pellentesque luctus ligula, sit amet vehicula sapien imperdiet a. Suspendisse sed lacus at eros tristique vehicula eget sit amet sem.


FLUID COLUMN

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus, ac egestas augue laoreet a. Quisque varius ligula non est porta sit amet dictum orci consequat. Morbi pellentesque luctus ligula, sit amet vehicula sapien imperdiet a. Suspendisse sed lacus at eros tristique vehicula eget sit amet sem.

Fixed Block (with negative values)

This is another option to use when you need one fixed column and one fluid column.

Improve intro text & show code structure

FLUID COLUMN

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus, ac egestas augue laoreet a. Quisque varius ligula non est porta sit amet dictum orci consequat. Morbi pellentesque luctus ligula, sit amet vehicula sapien imperdiet a. Suspendisse sed lacus at eros tristique vehicula eget sit amet sem.

FIXED COLUMN

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus, ac egestas augue laoreet a. Quisque varius ligula non est porta sit amet dictum orci consequat. Morbi pellentesque luctus ligula, sit amet vehicula sapien imperdiet a. Suspendisse sed lacus at eros tristique vehicula eget sit amet sem.

Conditional Display

Some elements can be visible in some screen sizes and invisible in other. You can choose:

  • Hide something on mobiles: hide-on-phones
  • Hide something on tablets: hide-on-tablets
  • Hide something on desktops: hide-on-desktops
This Panel is not visible on phones
This Panel is not visible on tablets
This Panel is not visible on desktop

Typography

Typography is built with rems, so it easier to adapt the font sizes in different breakpoints.

rem: It is the size relative to the root element (or the HTML element). So we can define a single font size on the html element and it affects to all elements with rem units to be a percentage of that.

Paragraph example

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed imperdiet blandit nunc ut cursus. Integer viverra blandit erat, a feugiat dolor auctor ac. Proin tincidunt pulvinar velit, a tincidunt nisi semper eu.

Inline elements

Italic Text

<small>: Small text

<em>: Emphasys text

<strong>: Emphasys text

<pre>: text

default link

link without underline class="nu"

Force uppercase text class="upper"

Force lowercase text class="lower"

<code>: text

Headings

Headings exists from h1 to h6. Font sizes are defined in em

In addition to heading you can use add extra text. You can use the tag <small> inside the heading or add an adjacent heading with class subheader

h1. Heading 1 with extra notes

Subheader for h1

h2. Heading 2 with extra notes

Subheader for h2

h3. Heading 3 with extra notes

Subheader for h3

h4. Heading 4 with extra notes

Subheader for h4
h5. Heading 5 with extra notes
Subheader for h5
h6. Heading 6 with extra notes

Aligments

Align text on left side. class="al"

Align text on center. class="ac"

Align text on right side. class="ar"

Responsive typhography

For headings and other big size text we need to adapt font-size in relation to display width. We can do this width media queries and width a javascript function call adjustTextSize.

This function accept 3 parameters:

  1. strings: Elements to be resized
  2. set_max_size: boolean to limit maximum font size to its defined size in CSS
  3. min_size: Integer number to limit minimum font size.

All elements with class js-adjust-text will be adjusted

Default adjust text with no size limitations

Lorem ipsum

Lorem ipsum dolor sit

Lorem ipsum dolor sit amet, consectetur

Lorem ipsum dolor sit amet, consectetur kfdkfd fkk ckdsfn kjkjd fkjdfkjd ftur

$('.js-adjust-text').adjustTextSize(false, 12);

Adjust text with limitations

Lorem ipsum

Lorem ipsum dolor sit

Lorem ipsum dolor sit amet, consectetur

Lorem ipsum dolor sit amet, consectetur kfdkfd fkk ckdsfn kjkjd fkjdfkjd ftur

$('.js-adjust-text-limit').adjustTextSize(true, 30);

Lists

You can choose between different types of lists: empty list (default), unordered lists, ordered lists, and definition lists. In default ul lists we remove list styles, because in our apps most of times we don't want that our lists look like lists

Default list

<ul>

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Aliquam tincidunt mauris eu risus.
  • Vestibulum auctor dapibus neque.

List with Discs

<ul class="discList">

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Aliquam tincidunt mauris eu risus.

Definition List

<dl><dt>

definition list dt
definition list dd
definition list dt
definition list dd

Order List

<ol>

  1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  2. Aliquam tincidunt mauris eu risus.

List with Squares

<ul class="squareList">

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Aliquam tincidunt mauris eu risus.

Horizontal list

<ul class="horizontalList">

  • Item 1
  • Item 2
  • Item 3

List with Circles

<ul class="circleList">

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Aliquam tincidunt mauris eu risus.

Horizontal list centered

<ul class="horizontalList ac">

  • Item 1
  • Item 2
  • Item 3

Forms

Inputs

To use autofocus property just add "autofocus" to input tag
with autofocus property
default note
It must start with a valid URI scheme, (http://, ftp:// or mailto:)
It does not enforce a particular syntax
By default it will only take one, but if the multiple attribute is provided, a comma separated list of email addresses is valid.
A text input field styled in a way that is consistent with the platform's search field

Other possible input types are: number, color, range, datetime, datetime-local, date, time, week, month. more info here

Checkboxs & Radio buttons

<div class="fg checkboxGroup">
  <label>Checkbox Group</label>
  <div class="options">
    <div class="option">
      <input type="checkbox" id="name" class="checkbox">
      <label for="name">option 1</label>
    </div>
    <div class="option">
      <input type="checkbox" id="name" class="checkbox">
      <label for="name">option 2</label>
    </div>
  </div>
</div>
<div class="fg radioGroup">
  <label>Radio Group</label>
  <div class="options">
    <div class="option">
      <input type="radio" id="name" class="radio">
      <label for="name">option 1</label>
    </div>
    <div class="option">
      <input type="radio" id="name" class="radio">
      <label for="name">option 2</label>
    </div>
  </div>
</div>

Horizontal Fields

It is possible to display field groups inline. To do it you only need to wrap your fields in a panel with class fh

Buttons

Adding the class bt to a link, submit button or button element make them look like buttons.

Links as buttons

<a class="bt" href="#">Button</a>
Small button: bt_small
Small Link Button
Default button:
Medium Link Button
Large button: bt_large
Large Link Button
Block button: db
Full width button Buttons that display full width on mobiles
Full width mobile

Secundary button: bt_sub
Secundary Link Button Main Action Link Button

Secundary button: disabled
Disable Main Action Link Button Disable Secundary Link Button

States of buttons: bt_sub bt_success bt_danger
Default Subordinate Success Danger

<button> as buttons





Submit Inputs as buttons





Buttons with icons

Button small with icon Button small with right icon

Button medium with icon Button medium with right icon

Button large with icon Button large with right icon

Input with button

With this component it is possible to put a button next to a text field. The button has a fixed with, and the text field is responsive to fill its parent width. In the example we used a button with a width of 150 pixels, but you can expand the css to adapt it to you button desired width

Messages

Simple Block Messages

Warning message msg_warning:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus.
Info message msg_info:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus.
Success message msg_success:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus.
Error message msg_error:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus.

Block Messages with Icon

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus.

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus.

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus.

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar fringilla risus.

Block Messages with Javascript

It is possible to show messages with a javascript function showMsg()

Show Warning Message

Show Info Message

Show Success Message

Show Error Message

Notification Area:

Click on the left side buttons to show the selected message panel

$(wrapper Selector).showMsg(
    size: big|small,
    type: warning|error|success|info,
    scroll to panel: 0|1,
    title: "Lorem ipsum",
    description: "Lorem ipsum dolor sit amet, consectetur..."
);
            

Dialogs

TODO: Dialogs

Tabs

This component give you the core styles and javascript functions to let you use tabs.

Simple Tab 1
Simple Tab 2
Simple Tab 3
  • This is simple tab 1's content. Pretty neat, huh?

Tables

This component give you the core styles and javascript functions to let you use tables.

# Lorem ipsum dolor sit Aliquam
1 Vestibulum auctor dapibus
2 faucibus tortor eros
3 Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat. Pellentesque eleifend

Condensed Tables

# Lorem ipsum dolor sit Aliquam
1 Vestibulum auctor dapibus
2 faucibus tortor eros
3 Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat. Pellentesque eleifend

Responsive Tables

You can make your tables responsive just wrapping the table with a panel with the class table-responsive. In small widths the table will scroll horizontally

# Lorem ipsum dolor sit Aliquam
1 Vestibulum auctor dapibus
2 faucibus tortor eros
3 Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat. Pellentesque eleifend

Pagination

Images

This is the default way to include an image.

Responsive Images

Work in progress.

You can see it in this post.

We know several libraries that offer this feature, but none of them fix our needs completly. We need a solution that:

  • Work with out Javascript: If there is no Javascript on render time, then the large version of the image will be displayed
  • The version of the image to show depens of its parent size. Other libraries rely this on window width, and we thing that this is not the best method to do it.
  • Option to set diferent version sizes for different images groups: In a real project not all the images can be display with the same dimensions.
  • Create several version of the image on the server: First implementation will be in PHP, but we'll do it also for JAVA & Grails.
  • Bandwidth detection: If connection is slow the the lowest quality version of the image will be display.
  • Lazy load: Load images only when they are inside the viewport.

To resize the image we use the PHP script timthumb.php. To make it work you need:

  • Placed in a folder on your website. We like to inlcude it inside our main image folder.
  • Create a directory called 'cache' with 775 permisions.

make timthumb work with relative paths

Other components

Breadcrumbs

This is the structure that Google recommens for a breadcrumbs

Tooltips

TODO: Tooltips

Responsive video embed & Lazy Iframe Video load

If your page needs to load an iframe from Youtube or Vimeo you'll notice that you have 2 problems: Page load time became much more slower and the iframe doesn't fix it's responsive parent size.

To make you iframe fits the desire width and height you hace to use this HTML structure and remove every iframe tag related to dimensions.

Write code to embed responsive iframe

The problem with the page load time is that this kinds of iframe needs lots of resources to work fine. If we just embed one of those iframes the page will require al those Javascript and CSS, and our cool page'll became slower.

The solution that we use is to load the iframe only when the user want to see it (on user click).

At the moment it is only available to load video iframes from youTube and Vimeo.

Add ons

Font Awesome integration

To get more info abouit visit Font Awesome web site.

Scalable icons

To increase icon sizes relative to their container, use the fa-lg (33% increase), fa-2x, fa-3x, fa-4x, or fa-5x classes.

fa-camera-retro

fa-camera-retro

fa-camera-retro

fa-camera-retro

fa-camera-retro

fa-camera-retro

Fixed Width Icons

Use fa-fw to set icons at a fixed width. Great to use when variable icon widths throw off alignment. Especially useful in things like nav lists.


Rotated & Flipped

To arbitrarily rotate and flip icons, use the fa-rotate-* and fa-flip-* classes.

  normal
  fa-rotate-90
  fa-rotate-180
  fa-rotate-270
  fa-flip-horizontal
  icon-flip-vertical

Bordered & Pulled Icons

Use fa-border and pull-right or pull-left for easy pull quotes or article graphics.

Use a few styles together and you'll have easy pull quotes or a great introductory article icon.

Use a few styles together and you'll have easy pull quotes or a great introductory article icon.