Skip to content

Commit

Permalink
Use B_E--M style for class names
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed May 11, 2016
1 parent 3065282 commit 970ce61
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/ui/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<span class="v-avatar" :style="styleSize" :class="{'v-avatar--image': image}" :aria-label="alt">
<span class="v-avatar__text" v-text="name" :style="{background: bg, color: fg}"></span>
<span class="v-avatar_text" v-text="name" :style="{background: bg, color: fg}"></span>
</span>
</template>

Expand Down Expand Up @@ -95,7 +95,7 @@ export default {
.v-avatar--squared {
border-radius: 2px;
}
.v-avatar .v-avatar__text {
.v-avatar .v-avatar_text {
display: inline-block;
width: 100%;
height: 100%;
Expand All @@ -106,7 +106,7 @@ export default {
width: 100%;
height: 100%;
}
.v-avatar--image .v-avatar__text {
.v-avatar--image .v-avatar_text {
display: none;
}
</style>
6 changes: 3 additions & 3 deletions src/ui/ProgressButton.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<button class="v-progress-button v-button" :disabled="disabled">
<span class="v-progress-button__progress" :style="{width: width}"></span>
<span class="v-progress-button__text"><slot></slot></span>
<span class="v-progress-button_progress" :style="{width: width}"></span>
<span class="v-progress-button_text"><slot></slot></span>
</button>
</template>

Expand Down Expand Up @@ -38,7 +38,7 @@ export default {
position: relative;
text-align: center;
}
.v-progress-button__progress {
.v-progress-button_progress {
position: absolute;
top: 0;
left: 0;
Expand Down
6 changes: 3 additions & 3 deletions src/ui/Toggle.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<label class="v-toggle" :class="{'v-toggle--checked': checked}">
<input type="checkbox" v-model="checked" :name="name">
<span class="v-toggle__handle"></span>
<span class="v-toggle_handle"></span>
</label>
</template>

Expand Down Expand Up @@ -41,7 +41,7 @@ label.v-toggle--checked.v-toggle {
background: var(--vui-green);
border-color: var(--vui-green);
}
.v-toggle .v-toggle__handle {
.v-toggle .v-toggle_handle {
position: absolute;
left: 0;
top: 0;
Expand All @@ -53,7 +53,7 @@ label.v-toggle--checked.v-toggle {
z-index: 99;
transition: transform 0.3s;
}
.v-toggle--checked .v-toggle__handle {
.v-toggle--checked .v-toggle_handle {
transform: translate3d(37px, 0, 0);
}
.v-toggle::before,
Expand Down
16 changes: 8 additions & 8 deletions src/view/Overlay.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div class="overlay">
<div class="overlay__mask" @click="show=false"></div>
<button class="overlay__close" aria-label="关闭" @click="show=false">
<div class="overlay_mask" @click="show=false"></div>
<button class="overlay_close" aria-label="Close" @click="show=false">
<svg viewBox="0 0 40 40" tabindex="-1">
<circle cx="20" cy="20" r="18" stroke="#ccc" stroke-width="1" fill-opacity="0"/>
<line x1="15" y1="15" x2="25" y2="25" stroke="#dadada" stroke-width="2"/>
<line x1="15" y1="25" x2="25" y2="15" stroke="#dadada" stroke-width="2"/>
</svg>
</button>
<div class="overlay__content">
<div class="overlay_content">
<slot name="overlay-hide"></slot>
<slot></slot>
</div>
Expand Down Expand Up @@ -71,7 +71,7 @@ export default {
.overlay--open .overlay {
display: flex;
}
.overlay__mask {
.overlay_mask {
position: absolute;
left: 0;
top: 0;
Expand All @@ -80,14 +80,14 @@ export default {
z-index: 10;
cursor: pointer;
}
.overlay__content {
.overlay_content {
position: relative;
max-width: 860px;
height: 100%;
z-index: 22;
flex: 1;
}
button.overlay__close {
button.overlay_close {
position: absolute;
display: block;
border: none;
Expand All @@ -102,13 +102,13 @@ button.overlay__close {
animation: fade-in 1s cubic-bezier(1, 0.06, 0.74, 1);
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
button.overlay__close svg {
button.overlay_close svg {
width: 40px;
height: 40px;
outline: none;
}
@media (max-width: 680px) {
.overlay button.overlay__close {
.overlay button.overlay_close {
right: 20px;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/view/SideMenus.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="v-side-menus" :class="menuClass">
<slot name="left-menu"></slot>
<div class="v-side-menus__content">
<div class="v-side-menus_content">
<slot></slot>
</div>
<slot name="right-menu"></slot>
Expand Down Expand Up @@ -44,7 +44,7 @@ export default {
.v-side-menus [slot=right-menu] {
right: 0;
}
.v-side-menus .v-side-menus__content {
.v-side-menus .v-side-menus_content {
position: relative;
width: 100%;
height: 100%;
Expand All @@ -53,17 +53,17 @@ export default {
background: white;
z-index: 99;
}
.v-side-menus--left .v-side-menus__content,
.v-side-menus--right .v-side-menus__content {
.v-side-menus--left .v-side-menus_content,
.v-side-menus--right .v-side-menus_content {
position: fixed;
width: 100%;
perspective: 1000px;
}
.v-side-menus--left .v-side-menus__content {
.v-side-menus--left .v-side-menus_content {
transform: translate3d(275px, 0, 0);
box-shadow: -3px 0 6px rgba(0, 0, 0, 0.1), -6px -6px 8px rgba(0, 0, 0, 0.05);
}
.v-side-menus--right .v-side-menus__content {
.v-side-menus--right .v-side-menus_content {
transform: translate3d(-275px, 0, 0);
box-shadow: 3px 0 6px rgba(0, 0, 0, 0.1), 6px 6px 8px rgba(0, 0, 0, 0.05);
}
Expand Down

0 comments on commit 970ce61

Please sign in to comment.