1. postcss-property-lookup
PostCSS plugin that allows referencing property values without a variable
postcss-property-lookup
Package: postcss-property-lookup
Created by: simonsmith
Last modified: Fri, 24 Jun 2022 10:39:36 GMT
Version: 3.0.0
License: MIT
Downloads: 311,816
Repository: https://github.com/simonsmith/postcss-property-lookup

Install

npm install postcss-property-lookup
yarn add postcss-property-lookup

postcss-property-lookup Build Status

PostCSS plugin that allows referencing property values without a variable, similar to Stylus.

 .Test {
  margin-left: 20px;
  margin-right: @margin-left;
  color: red;
  background: @color url('test.png');
  line-height: 1.5;
  font-size: @(line-height)em;
}
 .Test {
  margin-left: 20px;
  margin-right: 20px;
  color: red;
  background: red url('test.png');
  line-height: 1.5;
  font-size: 1.5em;
}

Check the test fixtures for more examples.

Usage

 postcss([ require('postcss-property-lookup') ])

See PostCSS docs for examples for your environment.

Installation

$ yarn add postcss-property-lookup

Usage

JavaScript

 postcss([
  require('postcss-property-lookup')(/* options */),
  // more plugins...
])

TypeScript

 ///<reference path="node_modules/postcss-property-lookup/.d.ts" />
import postcssPropertyLookup from 'postcss-property-lookup';

postcss([
  postcssPropertyLookup(/* options */),
  // more plugins...
])

Options

logLevel

Type: string: <error|warn>

Required: false

Default: warn

When a lookup cannot be resolved, this specifies whether to throw an error or log a warning. In the case of a warning, the invalid lookup value will be replaced with an empty string.

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin