Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #115 from pocka/fix/reset-all-style
Browse files Browse the repository at this point in the history
Do not reset all styles with all: initial
  • Loading branch information
pocka authored Sep 24, 2019
2 parents 6b053bc + b66e609 commit e1cb5f8
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 6 deletions.
26 changes: 26 additions & 0 deletions example/stories/issues/21/BulmaButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script>
export default {
mounted() {
const style = document.createElement('style')
style.textContent = `
body {
color: tomato;
}
`
style.dataset.savi = 'true'
document.querySelector('head').appendChild(style)
},
beforeDestroy() {
document
.querySelector('head')
.removeChild(document.querySelector('style[data-savi]'))
}
}
</script>

<template>
<span>BUTTON</span>
</template>
17 changes: 17 additions & 0 deletions example/stories/issues/21/index.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { storiesOf } from '@storybook/vue'

import BulmaButton from './BulmaButton'

storiesOf('Issues/#21', module).add(
'Do not reset preview style',
() => ({
components: { BulmaButton },
template: '<bulma-button/>'
}),
{
info: {
docsInPanel: false,
summary: '<https://github.com/pocka/storybook-addon-vue-info/issues/21>'
}
}
)
7 changes: 6 additions & 1 deletion src/components/Component/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.container {
font-family: Roboto, sans-serif;
}

.container > :not(:first-child) {
margin-top: 24px;
}
Expand All @@ -6,9 +10,10 @@
font-size: 24px;
margin: 0;

color: #333;
font-weight: 400;
}

.required {
color: #A01A1A;
color: #a01a1a;
}
1 change: 0 additions & 1 deletion src/components/Docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
left: 0;
padding: 40px;

font-family: Roboto, sans-serif;
overflow: auto;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
</script>

<template>
<div>
<div :class="$style.container">
<h1 :class="$style.title">{{ title }}</h1>
<h2 :class="$style.subtitle">{{ subtitle }}</h2>
</div>
Expand Down
9 changes: 7 additions & 2 deletions src/components/Header/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
.title, .subtitle {
.container {
color: #333;
font-family: Roboto, sans-serif;
}

.title,
.subtitle {
margin: 0;
}

Expand All @@ -13,5 +19,4 @@
margin-top: 8px;

font-weight: 400;
color: #333;
}
1 change: 0 additions & 1 deletion src/components/Preview/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.preview {
all: initial;
position: relative;
display: block;
}
1 change: 1 addition & 0 deletions src/components/SectionContainer/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
color: #fff;
background-color: #333;
border-radius: 4px 4px 0 0;
font-family: Roboto, sans-serif;
text-transform: uppercase;
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/Summary/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.container {
font-family: Roboto, sans-serif;
}

.container h1 {
font-size: 24px;
}
Expand Down

0 comments on commit e1cb5f8

Please sign in to comment.