Welcome Guest, Not a member yet? Register   Sign In
Less css library
#1

[eluser]Romyblack[/eluser]
Hi everyone,

Today I'll share with you this library I've made for a project.

The library has the documentation inside but here it is anyway.
NOTE:This library implements the class created by Leaf Corcoran [http://leafo.net]
Quote:Note: If you find this library helpful please say thanks and share it with people you know need this.

Documentation
This class lets you to implement the Less languaje in your own server.

*1)Use the same documentation to create the files at. http://lesscss.org
*2)Compress your css.
*3)Cache your css.

Implementation

*1)Create a controller with the name [css.php] with this code.

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

  class Css extends CI_Controller {

   public function __construct()
   {
    parent::__construct();
   }
  
   public function page($file = FALSE)
   {
    //$this->output->cache(999999);
    $config['css_path']  = "./css/$file";
    $config['compress']  = TRUE;
    
    $this->load->library('less_css',$config);
    $this->less_css->parse();
   }
  }

  #End of file css.php
  #Location: ./application/controllers/css.php
*2)Create a folder with the name [css] at ./.
*3)Create a .css file with the name style.css and paste this code.


Code:
@bg_color: #000000;
  #footer {
   background: @bg_color;
   border-top:1px dotted #666;
   padding-bottom:50px;
   & li {
    list-style:none;
   }
   & #footer_contact, #footer_direction, #footer_menu, #footer_portfolio {
    float:left;
   }
   & #footer_menu li a,  #footer_portfolio li a {
    text-decoration:none;
    text-transform:uppercase;
    font-weight:bold;
    font-size:12px;
    padding:3px 0 0px 15px;
    display:block;
   }
  }
*4)Access to the url http://localhost/yourproject/css/page/style.css
*5)When the css is ready to production i recommend to uncomment the line below to enable caching.


Code:
$this->output->cache(999999);
*6)Enjoy.


Quote:Tags: Less, CI_Lesscss, LessCss, Less css, Codeigniter, Romyblack Smile

Here's the link : Download Less css library
Save at \application\libraries\Less_css.php
#2

[eluser]Elric[/eluser]
Excellent Work!! Thank you for sharing!!
#3

[eluser]quickshiftin[/eluser]
Very cool!




Theme © iAndrew 2016 - Forum software by © MyBB