Added automatic prefixing to CSS variables in Visual Studio Code

I'm trying to find a way to configure css-auto-prefixer in Visual Studio Code so that it prepends the auto-prefixed css values instead of appending them.

For example, when I enter a prefixable property like border-radius, the auto-prefixer adds -webkit-border-radius (as expected). However, it currently appends it to the list, leading to issues with browser compatibility.

border-radius: .5rem;
-webkit-border-radius: .5rem;

Since CSS is a cascading style sheet, ideally the unprefixed property should be listed last and the retro properties first for better prioritization.

-webkit-border-radius: .5rem;
border-radius: .5rem;

Answer №1

Format your CSS properties like this:

-bdrs and when you select border-radius from the suggestions, the vendor prefixes will be automatically added before the unprefixed version. To enable this functionality, begin the property with a dash -.

This is an actual example cited in the documentation: refer to https://code.visualstudio.com/docs/editor/emmet#_include-vendor-prefixes.


If you prefer not to utilize emmet abbreviations, consider checking out https://marketplace.visualstudio.com/items?itemName=sporiley.css-auto-prefix or https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-autoprefixer

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Add the onmouseover attribute to dynamically alter the text

I'm trying to add the onmouseover function to the image of Angelina Jolie in order to change the text above, which currently says "Your Daily Dose of Contrabang". What is the best way to achieve this? Thank you for your assistance. You can check out t ...

iPhone images are taking forever to load in web applications and Safari

I am currently developing a Progressive Web App (PWA) for Android and iOS. While I have not encountered any issues with image loading on Android, there seems to be a delay when loading images on iOS Safari and the web app version. Specifically, when displa ...

Different Ways to Conceal a Div Element Without Using Jquery

One interesting feature of my website is that users can select audio from a drop-down box, triggering the $.post function to display an auto-playing audio player in a div. However, I'm facing a problem because I don't want the audio player to be ...

Center text within a div container

I am facing an issue with a nested div element: <div id="footer"> <div id="footer_text"> <p>My foooo text</p> </div> </div> The CSS code for the nested div is as ...

Utilize jQuery to display or toggle each element individually, ensuring that only one is visible on the screen at any given time

Here are some clickable links: About Portfolio Resume Upon clicking 'About', I want the About section to appear while hiding the Portfolio and Resume sections (and vice versa)... This is how my code is structured (relevant parts only): HTML: ...

Move the div in an animated way from the bottom of the screen to the right

I am facing an issue with the image animation in my project. Currently, the image moves from the bottom to the left corner, but I want it to move from the bottom to the right corner instead. I have attempted using the transform translate property to achiev ...

Updating the CSS properties of a specific element within a dynamically generated JavaScript list

So I'm working on a JavaScript project that involves creating a navigation bar with multiple lists. My goal is to use the last list element in the bar to control the visibility (opacity) of another element. So far, I have been using the following code ...

Wrapping Divs encircling a Round Div

Looking for advice on how to place 5 div elements around a circular div. Here's the code I currently have: .main{ border: 2px dotted #000000; border-radius: 50%; width: 500px; height: 500px; } .cirlce1{ height: 50px; width: 50px; border: 2px dotte ...

Firebase Functions Project encountering a "Cannot find module" error in VS Code

While working on a firebase functions project in Visual Studio Code, I encountered an issue inside the index.ts file. The imported modules were not being recognized even though autocomplete showed that the modules exist. When attempting to import them, I k ...

Creating a chic vertical stripe

Can someone help me create a vertical line that fades out at the end? I've attempted using the code below: div.vertical-line{ float:right; width:5px; background-color:black; margin-right:20px; background: #FFFFFF; background: ...

Ways to change the background color of a specific row and an entire table with JavaScript

In my application, I have implemented a feature where clicking on the "Add New Item" button adds rows dynamically using Javascript. Each input field in the dynamically added rows has a unique ID, and this functionality is working smoothly. When a number f ...

Ensure that the label control is aligned to the left within the <div> element

I need assistance with aligning elements within my web page that contains some ASP.NET controls. Specifically, I am looking to align the Label control to the right within a div tag. Can someone provide guidance on how to achieve this alignment? Edit: Bel ...

Unable to apply the CSS `::first-letter` pseudo-element using the `:not

One of the tasks at hand is to increase the size of the initial letter in each P element that does not have the class ejemplo or the id lectura. The following code snippet accomplishes this successfully: p::first-letter { font-size: 300%; } However, t ...

Tips for positioning a solitary md-tab component to the right

Can a single md-tab element be aligned to the right of md-tabs while keeping the rest of the tabs in their original position? ------------------------------------------------------------------------- | Tab 1 | Tab 2 | Tab 3 | ...

An innovative approach to loading tabs dynamically using Materialize CSS

I have a situation where I am dynamically generating a set of tabs when the page loads, but for some reason the on function is not recognizing it. How can I fix this issue? Here is the current code: HTML <div class="row"> <div class="col s12 ...

Four columns positioned next to each other (Navigation Bar)

I've been trying to get these divs to display side by side for a menu bar, but they keep stacking on top of each other. I've experimented with margin-right/left/top/bottom, padding, and more, but nothing seems to work. Any suggestions? <div i ...

Searching for code and encoding text in Java

Hey there, I've encountered an issue with my program that fetches content from a website to my own using the URL connection class. The Java class outputs perfectly fine, but when I run the code on JSP, special characters like ¾à¤¨ and मà¥à ...

How do I fix the issue with my text being truncated?

While working on my website, I encountered an issue where the text is being cut off at the bottom of the page. I could adjust the margins and resize images and text to fit within the page, but I would prefer to allow scrolling on the webpage. Can anyone pr ...

The hidden overflow seems to be inconsistently effective

I've been working on creating some buttons with a rollover state. I have an image inside a div with overflow:hidden to hide the inactive state, but sometimes it doesn't work properly. What's even stranger is that when I inspect the page usi ...

Combining two divs to share the same linear gradient and shadow effect

Greetings to all our valued partners! I am seeking guidance on how to achieve the following task for a web application I am developing: Within my webapp, I have designed a stylish NavBar similar to the examples depicted in the images (in AdobeXD it is di ...