Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated
Stefan Izdrail
Founder & Senior Architect · 2026-06-29
Modern web development often involves complex processes and numerous tools to ensure smooth integration. It's common for developers to encounter various warnings while working on their projects, especially when using a framework like Laravel. One such warning is the deprecation of the color-adjust shorthand in your CSS code. To tackle this issue, follow these steps:
Step 1: Understand the Deprecation
The color-adjust shorthand was first introduced for addressing specific use-cases where color values needed to be adjusted based on viewing environments and mediums. Over time, however, it became less necessary as browsers started implementing better support for color manipulation. Today, the color-adjust shorthand has been deprecated in favor of print-color-adjust.
/* Deprecated Code */
a {
color: rgb(255,0,0);
color-adjust: 1; /* Deprecation Warning */
}
/* Updated Code */
a {
color: rgb(255,0,0);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
Step 2: Verify and Replace the Deprecated Code
- Locate the CSS file where the color-adjust shorthand is used.
- Replace the old code with the updated syntax, ensuring you maintain browser compatibility for different rendering engines like Webkit and print-color-adjust.
/* Old Code */
a {
color: rgb(255,0,0);
color-adjust: 1; /* Deprecation Warning */
}
/* Updated Code */
a {
color: rgb(255,0,0);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
Step 3: Update Laravel Project Files and Folders
If you've recently created a new Laravel project using the steps mentioned above, chances are that your autoprefixer config file (autoprefixer.css.php) might still contain the color-adjust shorthand definition. You can update this file by removing all references to color-adjust and replacing them with print-color-adjust./* Old Configuration */
return array(
// The $config variable is the final configuration object
'autoprefixer' => array(
// ... Other configurations
'browsers' => ['last 2 versions', 'safari 5.1'],
'color-adjust' => true, /* Deprecation Warning */
// ... Other configurations
),
);
/* Updated Configuration */
return array(
// The $config variable is the final configuration object
'autoprefixer' => array(
// ... Other configurations
'browsers' => ['last 2 versions', 'safari 5.1'],
'print-color-adjust' => true, /* Updated Deprecated Shorthand */
// ... Other configurations
),
);
Step 4: Run and Review Your Project
- Compile and run your updated Laravel project.
- Check if there are any errors or warnings related to color-adjust deprecation. If not, you've successfully solved the issue.
In conclusion, following these steps will ensure that your Laravel projects are free from deprecated code and can function without issues. By updating your project files to use print-color-adjust instead of color-adjust, you are not only addressing compatibility concerns but also future-proofing your code as browsers continue to improve their support for advanced CSS features.