Skip to content

Commit

Permalink
icon use svg
Browse files Browse the repository at this point in the history
  • Loading branch information
陈峰 committed Oct 23, 2018
1 parent 7ef702b commit 9ba8fb4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11,641 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

Simple JSON viewer component, for Vue.js 2

[![Build Status](https://travis-ci.org/chenfengjw163/vue-json-viewer.svg?branch=master)](https://travis-ci.org/chenfengjw163/vue-json-viewer)


[![Travis](https://img.shields.io/travis/chenfengjw163/vue-json-viewer/master.svg?style=flat-square)](https://travis-ci.org/chenfengjw163/vue-json-viewer)
[![npm](https://img.shields.io/npm/v/vue-json-viewer.svg?style=flat-square)](https://www.npmjs.com/package/vue-json-viewer)

- [Installing](#installing)
- [Example](#example)
Expand Down
5 changes: 5 additions & 0 deletions lib/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 13 additions & 18 deletions lib/json-viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -225,25 +225,19 @@ export default {
}
.jv-toggle {
background-image: url(./icon.svg);
background-repeat: no-repeat;
background-size: contain;
background-position: center center;
cursor: pointer;
&:before {
content: "";
padding: 0px 2px;
border-radius: 2px;
position: absolute;
}
&:after {
content: " ";
position: relative;
display: inline-block;
width: 16px;
}
width: 10px;
height: 10px;
margin-right: 2px;
display: inline-block;
transition: transform 0.1s;
&.open {
&:before {
content: "";
}
transform: rotate(90deg)
}
}
Expand All @@ -264,6 +258,7 @@ export default {
z-index: 2;
color: #888;
transition: all 0.1s;
transform: rotate(-90deg)
// background: red;
}
Expand All @@ -278,14 +273,14 @@ export default {
background: linear-gradient(
to bottom,
rgba(0, 0, 0, 0) 20%,
rgba(230, 230, 230, 1) 100%
rgba(230, 230, 230, 0.3) 100%
);
transition: all 0.1s;
}
&:hover {
.jv-toggle {
top: 50%;
top: 50%;
color: #111;
}
Expand Down
Loading

0 comments on commit 9ba8fb4

Please sign in to comment.