padaliyajay / php-autoprefixer Goto Github PK
View Code? Open in Web Editor NEWCSS autoprefixer written in pure PHP
License: MIT License
CSS autoprefixer written in pure PHP
License: MIT License
Hi
I was trying out your prefixer at last, and added it to my composer.json and as both dev-master and 1.0 versions the Vendor dir is missing... so i get
Fatal error: Uncaught Error: Class 'Padaliyajay\PHPAutoprefixer\Vendor\IE' not found...
Did i miss something?
Will try a manual install in the meantime,
TIA
I see that you remove zero (0)
when it's in expression 0.5px
or calc(-0.5em + 10%)
etc. which is great and I really love it as it makes final CSS smaller.
What about another optimization? Remove unnecessary quotes?
Currently I use this to remove them:
$prefixed_css = str_replace(
array(
'[role="button"]',
'[type="button"]',
'[type="reset"]',
'[type="submit"]',
'[type="search"]',
'[type="file"]',
'[type="checkbox"]',
'[type="radio"]',
'="top"',
'="right"',
'="bottom"',
'="left"',
),
array(
'[role=button]',
'[type=button]',
'[type=reset]',
'[type=submit]',
'[type=search]',
'[type=file]',
'[type=checkbox]',
'[type=radio]',
'=top',
'=right',
'=bottom',
'=left',
),
$prefixed_css
);
Sir, I found that my comment lines in CSS file were removed completely after passing to Autoprefixer()
May be because of the PHP CSS Parser.
Could you please help me fix it ?
Sorry my English is bad.
Hi everyone,
it might be useful to add support for new viewport units (svh, lvh, svw, lvw, dvh, dvw).
https://redstapler.co/all-css-viewport-units-svh-lvh-svw-lvw-dvh-dvw-explained/
Right now a css rule:
body{
height: calc(100svh - 55px);
width: 100svh;
max-width: 100vh;
}
becomes:
body { width: 100s vh; max-width: 100vh; }
This should mean modifying the submodule sabberworm/PHP-CSS-Parser.
With css code of:
@if ($menu_align_center = 1) {
@media (min-width: 769px) {
#topnavbar.navbar .navbar-nav {
display: inline-block;
float: none;
}
#topnavbar.navbar .navbar-collapse {
text-align: center;
}
}
}
@media print {
a[href]:after {
content: none !important;
}
}
The output is mangled and looks like:
@if ($menu_align_center = 1) {
display: inline-block;
float: none;
} #topnavbar.navbar .navbar-collapse {
text-align: center;
}
}
@media print {
content:none
!important;
}
:placeholder-shown
should be prefixed to
:-moz-placeholder-shown
and when I put this rule to
Mozilla.php
it works, but there are some non-prefixed rules, like
.form-floating > .form-control:focus ~ label, .form-floating > .form-control:not(:placeholder-shown) ~ label, .form-floating > .form-select ~ label
it should be prefixed to
.form-floating > .form-control:not(:-moz-placeholder-shown) ~ label, .form-floating > .form-select ~ label
but it's not... :/
when there are expressions like
background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity)) !important;
or
color: rgba(var(--bs-body-color-rgb), var(--bs-text-opacity)) !important;
then it will complete delete them
Hey padaliyajay, we are currently working with https://leaverou.github.io/prefixfree/
I see that project, cause we are finding a pure PHP server side solution.
Could you explain what is the current state of the project?
Thanks for share!
I think the rule is missing for transform-origin, It should be prefixed for webkit, no?
'transform-origin' => '-webkit-transform-origin'
Hi, is there something else I should install with Composer to make this work? I'm using the default installation, and the generated CSS is just the original CSS without comments. No -webkit nor any other prefixes seem to be added at all. Thanks for your support.
Hi,
it might be useful to add support to backdrop-filter property.
https://www.webkit.org/blog/3632/introducing-backdrop-filters/
Can you help me in adding support on Older version of Opera
While using your autoprefixer with new Bootstrap 5.1.1 correctly compiled by scssphp-1.7.0 I can see that values like these are removed (completely erased from output)
background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity)) !important;
color: rgba(var(--bs-body-color-rgb), var(--bs-text-opacity)) !important;
Hi Jay.
I was exited about this project, so i have try to implement on my project.
I'm working with compiling and cacheing on the fly, currently working with prefixfree.css
I test it and I advice have a big compile time (10-20+ secs).
Without phpautoprefix (but processing sass, minify, jspack, etc), compile time is 2-3secs.
In other hand, prefixfree.css has a clientside compile time of 50ms...
So, what can you say about it.
I love this feature/package, but on current compile times i have to avoid it.
Thanks for share your work.
The last Version (1.3) was released in 2019 and doesnt contain the new features.
We would like to use the features and therefore want to update to a new version but using the master branch as version is no ideal.
Are you planning to release a new version of this plugin?
Hi, I found your project after looking for a PHP autoprefixer that works with scssphp. I just wanted to check with you if this library is still being maintained and if you know if it works with scssphp compiler?
Thanks
Hi,
noticed that when parsing css with php-autoprefixer, the comments are removed in the resulting css file.
Is there a way to preserve them in the resulting css file?
Hello,
Very good thank you for creating this. How can we specify older browser versions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.