Skip to content

Conversation

@kscc25
Copy link
Contributor

@kscc25 kscc25 commented Nov 4, 2021

Use case:

.stylelintrc

    "csstools/value-no-unknown-custom-properties": [true, {
      "resolver": {
        "extensions": [".css"], 
        "paths": ["./src/assets/css"] 
        "moduleDirectories": ["node_modules"] 
      }
    }]

src/assets/css/styles.css

:root {
	--color1: red;
}

node_modules/awesome-package/button.css

:root {
	--button-radius: 2px;
}

Button.css

@import 'styles.css';
@import 'awesome-package/button.css';

.button {
    color: var(--color1);
    border-radius: var(--button-radius);
}

This is inspired by path resolver in https://github.com/postcss/postcss-import

@ronilaukkarinen ronilaukkarinen mentioned this pull request Mar 23, 2022
@Antonio-Laguna Antonio-Laguna merged commit a798de1 into csstools:master Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants