React. How to add autoprefixer package in and config it? - css

I search over the whole internet and do not find an answer on the question - how I can add the vendor prefixes support for my css files on production build?
So, I found two articles on this question, but it does not help me `.
https://medium.com/#kitze/configure-create-react-app-without-ejecting-d8450e96196a
https://medium.com/#ruanjian/configure-css-for-create-react-app-8681c6eb5f00

You don't need to use any vendor prefixes if you have created your React app by the script create-react-app, it does use autoprefixer.

Related

Allow comments when compiling sass with Laravel mix in production

Laravel mix removes all comments (except the ones formatted with /*!) when compiling sass into css on production.
Our CMS 'Umbraco' needs a specific comment format preceding css-selectors though.
e.g. /**umb_name: title*/
Does anyone know how to preserve comments when running npm run production with laravel mix?
kind regards, Marco

How can I convert scss files for use as css

I inherited a website that uses scss files for styling specific pages. I am not familiar with scss.
I just want to make a few changes. How can I convert the scss files to css?
I tried a quick and dirty method of using the browser's inspector to copy the parsed css, but it seems to capture the pieces that make scss work. The online converters fail with undefined variable issues. I am willing to do the homework, if you can point me in the right direction.
Thanks.
Basically you need a compiler for Sass, and for this you need: NodeJS, npm and install Sass.
Install Sass
So you need:
Install NodeJS;
Install npm;
Install Sass.
If you search the Internet you find enough content on the three and how to install in your environment (Windows, Linux or Mac).

Next.js Is there a way to have built in css-sass enabled while adding less configuration?

I want to use the css/sass built-in feature in Next.js while I want to add less configuration.
The css/sass built-in is fine but as soon as I add less to next.config.js, it disables the feature so I have to configure them like before one bye one using:
#zeit/next-sass
#zeit/next-less
#zeit/next-css
Is there a way to keep the feature enable while adding just less config?
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected. after adding less configuration!
Next.js disables all built-in CSS support if you have any custom CSS preprocessor.
So, if you add a custom plugin to process Less and need support for CSS and Sass, you would have to setup those plugins as well.
Next.js webpack config source code

Alternatives to Webpack styelint-webpack-plugin? Looking for a maintained project

I'm looking to install Webpack4 for a project.
Part of what I want it to do is lint css.
Just about every resource I find points to "stylelint-webpack-plugin" (https://github.com/JaKXz/stylelint-webpack-plugin).
That project's not been getting updated for a long time.
From what I can tell the webpack team bullied the dev responsibile for lots of the work on stylelint-webpack-plugin right out of the community.
So now the project's got nobody doing the work and it's "looking for a maintainer". After that whole mess, doesn't look like anyone's signing up.
From my perspective -- Oh Well! Next !?
Is there a different alternative to stylelint-webpack-plugin for lint-ing styles in a webpack setup?
The stylelint-webpack-plugin now belongs to the official webpack-contrib GitHub organisation. The plugin's dependencies are up-to-date and it supports the latest version of stylelint (version 9).
I believe it is the still the most appropriate plugin for using stylelint within Webpack.

How to validate HTML/CSS files with grunt.js?

This is a noob question.
I would like to use grunt.js as a build tool for my web project. Can use grunt.js to validate my HTML/CSS files? Do you have an example of such a grunt.js file?
There is another plugin that seems to be updated more often and does not require java. grunt-html-validation. It has a number of options and has been working great for me. You can install and use it like this:
npm install grunt-html-validation --save-dev
Then put something like this in the initconfig of your Gruntfile.js
and this in appropriate places in your Gruntfile.js
grunt.loadNpmTasks('grunt-html-validation');
grunt.registerTask("default", ["validation"]);
There is also a number of useful options including the ability to relax errors based on a regular expression (could be useful for AngularJS for example) and the ability to save a report.
You can use the grunt plugin grunt-html. Beware, you will need Java on your computer to use it. It works well for me.
As of now there seem to be two popular HTML validation plugins:
grunt-html-validation
grunt-html
grunt-html-validation uses the W3C Markup Validation Service and grunt-html uses a local copy of the java-based The Nu HTML Checker.
They both work well and have very similar options so it comes down to whether you want to wait for an external service call or wait for a local java app.

Resources