Skip to main content

Audit: YOOTHEME PRO WORDPRESS THEME AND PAGE BUILDER

PostCSS is a programming tool that uses JS plugins to transform styles. The plugins can do different tasks in CSS, like transpiling CSS syntax, supporting mixins and variables, linting CSS, inlining images and much more. PostCSS has grown popular in recent times, and is now being used by huge corporations such as Alibaba, Wikipedia and others. It is also relatively easy to use, giving the developer an easy time to get the output that they require.

Get to know more office.com/setup


The following are the ways that are available for you to get started with PostCSS:

Codepen
Prepos
Gulp
I would like us to discuss how to get started using Gulp, the task runner. The other two methods are also good, the only con with them is the fact that you do not have the ability to have control on the plugins you want use.

USING THE TASK RUNNER GULP TO INSTALL POSTCSS
To get started, you will need to have the following installed:

Node.js
NPM
Git

STEP 1
The first step is to install gulp. You can install it by opening terminal running this command. The -g extension means that we are installing globally:

npm install gulp -g
After successfully installing gulp, you will need to set up a gulp project. You will the need to create a package.json file and add it to your project. You can create it by using npm init command. After this, you then install the gulp package to the project. This is done by running this command, npm install gulp –save-dev. We use the extension –save-dev so that we can have it saved like a dev dependency.

After successfully following the above step, open the root of the project you have just created, then add a new file and name it gulp.js. We will need to allow this file access the package we installed above. We can do that by adding var gulp = require(‘gulp’); line on the top of the gulp.js file. Finally, you can optionally install plugins for gulp. This is not mandatory since gulp can use npm packages to get plugins.

STEP 2
We have now created our project. Just to make sure that we are on the same page, please check your project root folder and make sure that you have the following in it:

Package.json
Gulp.js
Installed gulp as development dependency

STEP 3
We are now going to go through the basic steps to install and work with PostCSS. The first step here will be to go to the root folder of your project, then create two sub folders, name one of them tstfoo and the other one src. All CSS files that are not processed will go to the src folder while the ones that have been processed to PostCSS will be stored in the tstfoo folder.

STEP 4
The next step will be to install a plugin that will be in charge of handling the processing of PostCSS files. The best plugin to use for this is the gulp-postcss plugin. To install this plugin, open your terminal and navigate to the root folder of your project using the cd command, the run this command;

npm install --save-dev gulp-postcss
Notice that your root folder has more sub folders under the node_modules folder after successful installation of the plugin.

Using a editor of your choice, you can now open the project, then open the gulp.js file for editing. We are now going to create variables that will be used to for calling the gulp-postcss and gulp modules that we just installed. To do that, we will add the following code to the file:

var gulp = require('gulp');
var postcss = require('gulp-postcss');
After successfully adding the above and following all the steps correctly, we are now able to create a task that will read a CSS file, then give an output through PostCSS. Let us start doing it by adding these lines of code to the gulp.js file:

Going through the piece of code above, the first line has a task called css whose purpose is to have a function executed. In the function to be executed, we have tools, which is an empty array at the moment.

In line four, we specify files that we want processed. That piece of code simply means any files in the scr folder with the extension .css. Then we have the tube function which sets PostCSS to use the function postcss() for execution. We have our array tube here as an argument. This will let PostCSS know about the plugins we will be using. In the last line of code, we are telling PostCSS where to store the processed CSS files.

STEP 5
Let us add a plugin example and see how it works. We will add a plugin called cssnext used for enabling future syntax. To do that, still pointing at your project folder, open the terminal and run this command;

npm install cssnext --save-dev
After that, open the gulp file and add the following line at the top:

var cssnext = require('cssnext');
We will also need to add the plugin to our tools array that was previously empty, your array should now look like this:

var tools = [
   cssnext
 ];
Now, we will edit the style.css file in our src folder in the project file to something like this:

.cssnext {
   background: color(green(-10%));
 }
After that, let us go back to the terminal again and run the command gulp css. If successful, check the new file in the tstfoo folder and you will notice changes, like this;

Comments

  1. If you have downloaded Office.com/setup and you are now struggling with how to install it on your Windows PC, then here are some steps through which you can easily install Microsoft Office on your computer. The process to install is given below.

    ReplyDelete
  2. Brother Customer Support is provided by the experts who are available at the brother printer support number. The Brother Support Service is active 24/7.

    ReplyDelete

Post a Comment

Popular posts from this blog

Do follow forum posting sites list

https://pharaonc.com/forum/index.php?topic=28551.0 https://www.hourhost.com/forums/showthread.php?tid=141975 http://www.labsimdev.org/phpBB3/viewtopic.php?f=2&t=83583 http://forum.italiadecals.com/viewtopic.php?f=2&t=77318 http://westhooligans.com/forum/showthread.php?tid=272186 http://aiforums.esy.es/showthread.php?tid=71115 http://nosarmy1.altervista.org/forum/showthread.php?pid=26250&tid=16837#pid26250 http://garyo.boy.jp/phpBB2/viewtopic.php?p=38174#38174 http://samilinlo.forumcrea.com/viewtopic.php?pid=2662#p2662 http://forum.shakingtree.com/viewtopic.php?p=9591#9591 http://whessissevyz.mihanblog.com/post/23 http://www.miniemotomaniaci.it/forum2/viewtopic.php?p=26706#26706 http://www.aragon.ws/phpBB/viewtopic.php?p=21950#21950 http://www.ultimate.ro/forum/viewtopic.php?f=151&t=78977 http://yourmidwestmedia.boardhost.com/viewtopic.php?pid=239712#p239712 http://foro.deperfumes.com/perfume-hombre/planned-pinoy-pinoy-bout-step-back-for-

How to Add Channels to Roku?

There are two kinds of channels that you can add to your Roku survey understanding: 1) Official Channels: These are introduced from the Roku Channel Store. You can include channels from the channel store utilizing a Roku gadget, Smartphone, or PC. 2) "Mystery", "Private", or "Non-Certified" Channels: These are not recorded in the Roku Channel Store and require an uncommon code to initiate utilizing a Smartphone or PC (not your Roku gadget). You will have the option to see these channels by means of your Roku gadget once included. Including an Official Channel Using a Roku Device To include a channel by means of a Roku gadget, press the Home Button on your Roku remote control, and after that snap on the Streaming Channels alternative. This will open the Roku Channel Store. In the Roku Channel Store look through any of the station classifications, (for example, New and Notable, Featured, Popular, Movies/TV, News/Weather, Kids/Family, Music, and that's j

10 PURE CSS MODAL WINDOW SNIPPETS

Modular windows were dependably the domain of JavaScript and there are a lot of contents to attempt. Get to know more about office.com/setup click here: Be that as it may, with CSS3 it's significantly less demanding to make a modular in unadulterated CSS. The impacts are to some degree constrained yet you can at present make an amazing knowledge without depending on scripting. The vast majority of these CSS models are dispersed to different corners of the web so I've curated the absolute best ones here. These shift from straightforward code bits to increasingly intensive libraries yet they're all open source and reusable. 1. CSS MODAL CSS Modal is a standout amongst the best activities you can discover for modals and it's facilitated straightforwardly on GitHub. It's an absolutely free CSS library for modals with custom livelinesss as well. You can include basically anything into the modals from plain content to picture exhibitions and inserted recor