Skip to content

Commit

Permalink
Merge pull request nostalgic-css#182 from panoramix360/ul_lists
Browse files Browse the repository at this point in the history
UL lists
  • Loading branch information
trezy authored Dec 13, 2018
2 parents 3d0dbfa + 0d89cbf commit 9fd5a6f
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 20 deletions.
20 changes: 20 additions & 0 deletions docs/lists.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
import { // eslint-disable-line import/no-extraneous-dependencies
withKnobs, radios,
} from '@storybook/addon-knobs';

const stories = storiesOf('Lists', module);
stories.addDecorator(withKnobs);

stories.add('list', () => {
const selectedClass = radios('type', {
default: 'is-disc',
'is-circle': 'is-circle',
}, 'is-disc');
return `<ul class="nes-list ${selectedClass}">
<li>Good morning.</li>
<li>Thou hast had a good night's sleep, I hope.</li>
<li>Thou hast had a good afternoon</li>
<li>Good night.</li>
</ul>`;
});
21 changes: 21 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,27 @@ <h2 class="title">Balloons</h2>
</div>
</section>

<section class="nes-container with-title">
<h2 class="title">Lists</h2>
<div class="lists">
<ul class="nes-list is-disc">
<li>Good morning.</li>
<li>Thou hast had a good night's sleep, I hope.</li>
<li>Thou hast had a good afternoon</li>
<li>Good night.</li>
</ul>
</div>

<div class="lists">
<ul class="nes-list is-circle">
<li>Good morning.</li>
<li>Thou hast had a good night's sleep, I hope.</li>
<li>Thou hast had a good afternoon</li>
<li>Good night.</li>
</ul>
</div>
</section>

<section class="nes-container with-title">
<h2 class="title">Table</h2>
<div class="tables">
Expand Down
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions scss/elements/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@import "containers.scss";
@import "radios.scss";
@import "checkboxes.scss";
@import "lists.scss";
@import "balloons.scss";
@import "tables.scss";
@import "progress.scss";
Expand Down
44 changes: 44 additions & 0 deletions scss/elements/lists.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.nes-list {
$disc: (
(0, 0, 0, 1, 1, 0, 0, 0),
(0, 0, 1, 1, 1, 1, 0, 0),
(0, 1, 1, 1, 1, 1, 1, 0),
(0, 1, 1, 1, 1, 1, 1, 0),
(0, 0, 1, 1, 1, 1, 0, 0),
(0, 0, 0, 1, 1, 0, 0, 0)
);

$circle: (
(0, 0, 0, 1, 1, 0, 0, 0),
(0, 0, 1, 1, 1, 1, 0, 0),
(0, 1, 1, 0, 0, 1, 1, 0),
(0, 1, 1, 0, 0, 1, 1, 0),
(0, 0, 1, 1, 1, 1, 0, 0),
(0, 0, 0, 1, 1, 0, 0, 0)
);
$colors: ($base-color, map-get($default-colors, "shadow"));

list-style-type: none;

& li {
position: relative;
}

&.is-disc li::before {
position: absolute;
top: calc(50% - 8px);
left: -22px;
content: "";

@include pixelize($disc, $colors, 2px);
}

&.is-circle li::before {
position: absolute;
top: calc(50% - 8px);
left: -22px;
content: "";

@include pixelize($circle, $colors, 2px);
}
}

0 comments on commit 9fd5a6f

Please sign in to comment.