-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* install storybook and addons * Configure storybook Base configuration: https://storybook.js.org/docs/guides/guide-vue/#step-3-create-the-config-file (see details) Add SASS support: https://storybook.js.org/docs/configurations/custom-webpack-config/#full-control-mode Global styles: storybookjs/storybook#1653 (comment) Accessibility addon: https://github.com/storybookjs/storybook/tree/master/addons/a11y * CTALink stories * Blog List stories * BlogListItem stories * ContentColumn stories * tweak styling * HeroHeader stories * Navigation stories And fixed a11y issue with nav links' text * start working on PageHeader stories * cleaned up page header styles * ReadingTime stories * TalkList stories * more tweaks * fix tests
- Loading branch information
Showing
39 changed files
with
4,743 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "@storybook/addon-a11y/register"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<div></div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Import styles | ||
import "!style-loader!css-loader!sass-loader!./scss-loader.scss"; | ||
|
||
// Import Storybook | ||
import { configure, addDecorator } from "@storybook/vue"; | ||
|
||
// Import storybook addons | ||
import { withA11y } from "@storybook/addon-a11y"; | ||
|
||
// Import Vue | ||
import Vue from "vue"; | ||
|
||
// Import Vue plugins | ||
import Vuex from "vuex"; | ||
import Meta from "vue-meta"; | ||
import Router from "vue-router"; | ||
|
||
// Import your global components. | ||
import SmartLink from "../src/components/SmartLink.vue"; | ||
|
||
// Install Vue plugins. | ||
Vue.use(Vuex); | ||
Vue.use(Meta); | ||
Vue.use(Router); | ||
|
||
// Register global components. | ||
Vue.component("smart-link", SmartLink); | ||
|
||
configure(require.context("../tests", true, /\.stories\.js$/), module); | ||
addDecorator(withA11y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "../src/assets/styles/app.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
const fs = require("fs"); | ||
|
||
// Export a function. Accept the base config as the only param. | ||
module.exports = async ({ config, mode }) => { | ||
// `mode` has a value of 'DEVELOPMENT' or 'PRODUCTION' | ||
// You can change the configuration based on that. | ||
// 'PRODUCTION' is used when building the static version of storybook. | ||
|
||
// Make whatever fine-grained changes you need | ||
config.module.rules.push({ | ||
test: /\.scss$/, | ||
use: ["vue-style-loader", "css-loader", "sass-loader"], | ||
include: path.resolve(__dirname, "../") | ||
}); | ||
|
||
config.plugins.push( | ||
new webpack.NormalModuleReplacementPlugin(/\.vue$/, resource => { | ||
const resPath = resource.request; | ||
const mockPath = resPath.slice(0, -3) + "mock.vue"; | ||
const absMockPath = path.resolve(resource.context, mockPath); | ||
const absRootMockPath = path.resolve(__dirname, "./component-stub.vue"); | ||
if (fs.existsSync(absMockPath)) { | ||
resource.request = mockPath; | ||
} else if (resPath.endsWith("Container.vue")) { | ||
resource.request = absRootMockPath; | ||
} | ||
}) | ||
); | ||
// Return the altered config | ||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.