0.1.8 • Published 10 months ago

svelte-preprocess-css-mods v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

svelte-preprocess-css-mods

npm version npm downloads

Successor of svelte-preprocess-cssmodules

Installation

npx nypm add -D svelte-preprocess-css-mods

Usage

Config

// svelte.config.js

import { cssModules } from 'svelte-preprocess-css-mods';

export default {
	preprocess: cssModules({/* options */}),
};

See options for more information.

Svelte

<!-- App.svelte -->
<script>
	import styles from './App.module.css';
</script>

<div class={styles.container}>
	<h1 class={styles.title}>Hello World!</h1>
</div>
/* App.module.css */
.container {
	display: flex;
	justify-content: center;
	align-items: center;
}

.title {
	color: red;
}

get converted into:

<script>
	const styles = {
		container: 'App_module_container',
		title: 'App_module_title',
	};
</script>

<div class={styles.container}>
	<h1 class={styles.title}>Hello World!</h1>
</div>

<style>
  .App_module_container {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .App_module_title {
    color: red;
  }
</style>

Related Works

License

MIT

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago