- This topic has 9 replies, 3 voices, and was last updated 5 years, 6 months ago by
Sebastian.
Author | Posts |
---|---|
ddenev
August 29, 2019 at 5:34 am
|
Heads up! this post was created when Microthemer was at version 5. The current version is 7. Some references to the interface may be out of date. Dear Sebastian, Currently, when using the normal CSS editing options, the vendor prefixes are added automatically and this is great. The thing is that when using SCSS, vendor prefixes are not auto added and we have to add them manually (or via mixins). Do you think it might be a good idea to incorporate an autoprefixer to take care of all vendor prefix stuff – https://github.com/postcss/autoprefixer? And since this works as a post-processor for CSS it might also take care of the vendor prefixes even when not using SCSS in MT (I guess you apply them yourself in the code in this case). Best regards, |
Sebastian
August 29, 2019 at 1:00 pm
|
Hi Drago, You are right to point this out. The reasons this doesn’t happen automatically with Sass enabled may not be applicable for much longer. Previously Sass was compiled on the server, where as vanilla CSS is formatted and rendered with JavaScript. This meant that the functionality had to be forked. Some things that were possible with vanilla CSS could not be easily carried over to Sass. Like adding prefixes. MT does this by parsing the CSS into property/value JS objects that can be easily manipulated. Until recently, MT wasn’t parsing Sass. It was just sending it to the sever to be converted to CSS. But the current beta does parse Sass, and renders it instantly. Now the two features can be merged. This means:
There may still be a case for using postCSS and the autoprefixer plugin. I will check how lightweight it is. These improvements to Sass support will have to wait a while though. I’m currently working on CSS grid and transform properties ๐ Cheers, |
adkoen
October 12, 2019 at 3:42 pm
|
Hi Sebastian, I just recently started to wonder about the same thing. Do you still have plans on adding an autoprefixer when using sass in Microthemer? |
Sebastian
October 14, 2019 at 1:02 pm
|
Good news, I’ve just added auto-prefixing support for Sass too. Please update to version 5.8.2.8. I initially thought this would need to happen at the same time as supporting synced Sass with the UI fields, which will be a fairly big job. But on closer inspection I realised that vendor prefixes could be supported fairly easily right now. Sorry for the unnecessary delay! The prefixes are added using native MT code, rather than pulling in the autoprefixer/post css library. If you are missing anything that library does, please let me know. Also, MT now adds !important to Sass styles too if that global setting is enabled. So remember to turn that off if you haven’t already: General > Preferences > CSS/SCSS > Always add !important to CSS styles > Off Cheers, |
adkoen
October 18, 2019 at 1:58 pm
|
Fantastic as always. I must have missed your reply to this, just reading it now. Your faster than anyone in the business! ๐ thank you! |
Sebastian
October 18, 2019 at 4:22 pm
|
You’re welcome ๐ |
ddenev
October 21, 2019 at 4:53 pm
|
Dear Sebastian, I would like to again bring front the topic of using Autoprefixer in MT and to provide my $0.02 as well. Although it is very nice and innovative (I haven’t seen a builder or CSS tool for WP do this) to automatically insert vendor prefixes, maintaining this functionality within MT has several (IMHO) drawbacks: – Maintenance and development of this functionality falls on your shoulders. Why spend time on updating the related code in MT compared to syncing (from time to time) the library which, from what I see, is very well maintained? We – your customers – I believe, would all prefer that you work on the important stuff ๐ There may be more benefits that I am currently missing but I am sure that you get the picture ๐ What do you think? |
Sebastian
October 22, 2019 at 11:43 am
|
Hi Drago, All very valid points. I just have two concerns that trump your benefits in the short-term, and maybe in the long term too. Short-term: development time Long-term: performance MT does quite a lot of data crunching after each keystroke or UI style change. With the latest speed improvements I’ve been careful to optimise all processes as much as possible to ensure a quick overall workflow. This concern will retain high priority as I continue to develop Microthemer. Right now, I know that adding prefixes alongside other related operations adds virtually no milliseconds at all. If there are any prefixes you’re missing, I would be happy to add them now, as I’m asking you to wait. I simply update the following file:
(see line 3332 for example) Cheers, |
ddenev
October 23, 2019 at 5:04 am
|
Dear Sebastian, Thank you for the detailed feedback! Re the short-term concerns – I totally agree with you – this requires time and dedication to make it work with MT, I understand that. I also never meant that this should shuffle all your current priorities, sorry if it sounded like that ๐ For me it is OK to wait since I am pretty sure that you see the benefits of this integration and you will come back to it at some point. Currently I cannot say that I am missing any prefixes since I haven’t used them (have being using SASS for some time) but I will keep an eye and will let you know. Thanks for pointing the file with the options. Best regards, |
Sebastian
October 23, 2019 at 11:43 am
|
OK great, we’ll come back to this at a later date then. I will make Sass styles syncable with the UI options in the not too distant future (excluding styles in nested selectors). That is when I will revisit autoPrefixer. As always, thanks for your well considered input Drago ๐ |