Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# CSS Modules

A **CSS Module** is a CSS file where all class names and animation names are scoped locally by default. All URLs (`url(...)`) and `@imports` are in module request format (`./xxx` and `../xxx` means relative, `xxx` and `xxx/yyy` means in modules folder, i.e. in `node_modules`).
A **CSS Module** is a CSS file where all class names and animation names are scoped locally by default. All URLs (`url(...)`) and `@imports` are in module request format (`./xxx` and `../xxx` means relative, `xxx` and `xxx/yyy` means in modules folder, i.e. in `node_modules`, `.yarn`, etc.).

CSS Modules compile to a low-level interchange format called ICSS (or [Interoperable CSS](https://github.com/css-modules/icss)) but are written like normal CSS files:

Expand All @@ -22,7 +22,7 @@ When importing a **CSS Module** from a JavaScript Module, it exports an object w
```js
import styles from './style.css';

element.innerHTML = '<div class="' + styles.className + '">';
element.innerHTML = `<div class="${styles.className}">`;
```

## Table of Contents
Expand Down
2 changes: 1 addition & 1 deletion docs/composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Similarly, `:local` and `:local(...)` for local scope.

If the selector is switched into global mode, global mode is also activated for the rules. (This allows us to make `animation: abc;` local.)

Example: ``
Example:

```css
.localA :global .global-b .global-c :local(.localD.localE) .global-d {
Expand Down
4 changes: 2 additions & 2 deletions docs/import-multiple-css-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You can import multiple CSS Modules into a component or function using `Object.a
For example, if you import a button CSS Module to your `Demo` component, add this to the components default styles.

```js
let styles = {};
const styles = {};
import demo from './Demo.css';
import fancyButton from 'css-fancy-button';
Object.assign(styles, fancyButton, demo);
Expand All @@ -33,7 +33,7 @@ A full example of a demo component with 2 css modules imported.

```jsx
import React from 'react';
let styles = {};
const styles = {};
import demo from './Demo.css';
import fancyButton from 'css-fancy-button';
Object.assign(styles, fancyButton, demo);
Expand Down
3 changes: 3 additions & 0 deletions docs/local-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ CSS Modules have class selectors scoped locally by default. For example, the fol

```css
.backdrop {
/* ... */
}
.prompt {
/* ... */
}
.pullquote {
/* ... */
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import themeA from 'component/theme-a.css';
import themeB from 'component/theme-b.css';
import customTheme from './custom-theme.css';

import {Component} from 'component';
import { Component } from 'component';

<Component theme={themeA} />
<Component theme={themeB} />
Expand Down