Does PHP automatically generate the CSS3 compatibility prefix?

Source: Internet
Author: User
CSS3 has many useful new attributes, such as rounded corners, shadows, and animations. However, these attributes are supported by private tags such as-moz-and-webkit-in different browsers. Therefore, when cross-browser implementation is required, an attribute must be written several times. Example: {code ...} there is... CSS3 has many useful new attributes, such as rounded corners, shadows, and animations. However, these attributes are supported by private tags such as-moz-and-webkit-in different browsers. Therefore, when cross-browser implementation is required, an attribute must be written several times. For example:

-webkit-box-shadow: 20px;-moz-box-shadow: 20px;box-shadow: 20px;

There is a good site (http://prefixr.com/) that can help generate these code. However, this is non-real-time generation and must be manually added to your own files. Therefore, modifications are cumbersome.

Is there a php implementation that only writes standard attributes in css, such

/* test.css */p{  box-shadow: 20px;}

After the css file is read through php and automatically identified, the following code is output in Real Time:

/* test.php?file=test.css */p{-webkit-box-shadow: 20px;-moz-box-shadow: 20px;box-shadow: 20px;}

In this way, css compilation, debugging, and modification become quite fast and can quickly generate publishing files. In the future, when the browser supports changes, you only need to modify the corresponding rules and then generate a file.

The trouble now is the complexity of CSS attributes, refer to the examples on the http://prefixr.com/Home Page involves most of them.
How does one implement automatic matching and addition through regular expressions?
Or are there any general implementation ideas?

Reply content:

CSS3 has many useful new attributes, such as rounded corners, shadows, and animations. However, these attributes are supported by private tags such as-moz-and-webkit-in different browsers. Therefore, when cross-browser implementation is required, an attribute must be written several times. For example:

-webkit-box-shadow: 20px;-moz-box-shadow: 20px;box-shadow: 20px;

There is a good site (http://prefixr.com/) that can help generate these code. However, this is non-real-time generation and must be manually added to your own files. Therefore, modifications are cumbersome.

Is there a php implementation that only writes standard attributes in css, such

/* test.css */p{  box-shadow: 20px;}

After the css file is read through php and automatically identified, the following code is output in Real Time:

/* test.php?file=test.css */p{-webkit-box-shadow: 20px;-moz-box-shadow: 20px;box-shadow: 20px;}

In this way, css compilation, debugging, and modification become quite fast and can quickly generate publishing files. In the future, when the browser supports changes, you only need to modify the corresponding rules and then generate a file.

The trouble now is the complexity of CSS attributes, refer to the examples on the http://prefixr.com/Home Page involves most of them.
How does one implement automatic matching and addition through regular expressions?
Or are there any general implementation ideas?

PHP implementation is not very clear, but there is a LESS javascript implementation. during compilation, special js files are called for fast debugging, and CSS files can be directly output during deployment.

This function should be generated by IDE, and phpstrome can complete this requirement through the plug-in.

RecommendedlessAnd other pre-processing tools;

You can try:

  • Http://ecomfe.github.io/est/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.