Skip to content

Commit

Permalink
updating docs for release
Browse files Browse the repository at this point in the history
  • Loading branch information
esr360 committed Jan 10, 2018
1 parent 9049990 commit c7fd1f9
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { Module, Component } from 'Synergy';

// Default configuration
import defaults from './accordions.json';

const Accordion = ({name = defaults.accordions.name, panels, modifiers}) => (
const Accordion = ({name = 'accordion', panels, modifiers}) => (
<Module name={name} modifiers={modifiers}>
{panels.map(({title, content}, index) => (
<Component name="panel" key={index}>
Expand All @@ -64,11 +61,11 @@ ReactDOM.render(

```html
<div class="accordion-foo-bar">
<div class="accordion_section">
<div class="accordion_panel">
<div class="accordion_title">foo</div>
<div class="accordion_content">bar</div>
</div>
<div class="accordion_section">
<div class="accordion_panel">
<div class="accordion_title">fizz</div>
<div class="accordion_content">buzz</div>
</div>
Expand All @@ -77,10 +74,12 @@ ReactDOM.render(

### Quick Look

Synergy uses a naming convention similar to BEM: __Module_Component-Modifier__, but unlike BEM, no keywords ever need to be repeated in selectors [Read More](#TODO).

###### HTML

```html
<div class="header-fixed">
<div class="header-dark-fixed">
<div class="header_logo">
...
</div>
Expand All @@ -95,6 +94,10 @@ ReactDOM.render(
// Core header styles
...

@include modifier('dark') {
...
}

@include modifier('fixed') {
...
}
Expand All @@ -110,8 +113,9 @@ ReactDOM.render(

```js
Synergy('header', header => {
const fixed = header.modifier('dark'); // returns Bool
const fixed = header.modifier('fixed'); // returns Bool
const logo = header.component('logo')[0]; // returns HTMLElement
const logo = header.component('logo')[0]; // returns HTMLElement

...
});
Expand Down Expand Up @@ -298,6 +302,8 @@ header ({
});
```

> Naturally, since this is JS, passing the `background` param here will not change the header's background, it merely exposes the value to `header.js` - probably not something that would be done in real life but is shown just for completeness
#### HTML Usage

Given the above, we would now be able to use any of the following markup examples:
Expand Down

0 comments on commit c7fd1f9

Please sign in to comment.