Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <main id="top" role="main">
    <div id="app">
      <div class="p-container">
        <accordion>
          <template v-slot:accordion-btn-txt>Study Neumorphism</template>
          <template v-slot:accrdion-content>汎用性の高いアコーディオンを作りながらついでにニューモーフィズムを少しお勉強しました。<br>以下はその時のメモです。<br>・背景をグラデーションにした方が綺麗。<br>・色を決めるときはフォトショのカラーピッカーからHSBのBの値を+-5くらいするといい感じになる。<br>・文字が#000だとめちゃくちゃ浮いて気持ち悪い。<br>・もじはカラーピッカーからHSBのBの値を-60くらいしたら馴染んだ。</template>
        </accordion>
        <accordion>
          <template v-slot:accordion-btn-txt>Study Neumorphism</template>
          <template v-slot:accrdion-content>汎用性の高いアコーディオンを作りながらついでにニューモーフィズムを少しお勉強しました。<br>以下はその時のメモです。<br>・背景をグラデーションにした方が綺麗。<br>・色を決めるときはフォトショのカラーピッカーからHSBのBの値を+-5くらいするといい感じになる。<br>・文字が#000だとめちゃくちゃ浮いて気持ち悪い。<br>・もじはカラーピッカーからHSBのBの値を-60くらいしたら馴染んだ。</template>
        </accordion>
        <accordion>
          <template v-slot:accordion-btn-txt>Study Neumorphism</template>
          <template v-slot:accrdion-content>汎用性の高いアコーディオンを作りながらついでにニューモーフィズムを少しお勉強しました。<br>以下はその時のメモです。<br>・背景をグラデーションにした方が綺麗。<br>・色を決めるときはフォトショのカラーピッカーからHSBのBの値を+-5くらいするといい感じになる。<br>・文字が#000だとめちゃくちゃ浮いて気持ち悪い。<br>・もじはカラーピッカーからHSBのBの値を-60くらいしたら馴染んだ。</template>
        </accordion>
      </div>
    </div>
  </main>
              
            
!

CSS

              
                html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
input,
button,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  font-size: 100%;
  vertical-align: baseline;
}

sup {
  position: relative;
  top: -0.1em;
  font-size: 70%;
  vertical-align: top;
}

sub {
  position: relative;
  font-size: 70%;
  vertical-align: bottom;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section,
main {
  display: block;
}

body {
  line-height: 1;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

*,
*:before,
*:after {
  -webkit-box-sizing: border-box;
  -o-box-sizing: border-box;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
}

*::-moz-selection {
  background: #000;
  color: #fff;
}

*::selection {
  background: #000;
  color: #fff;
}

html {
  font-size: 62.5%;
}

body {
  -webkit-font-feature-settings: "palt";
  -webkit-text-size-adjust: 100%;
  color: #000;
  font-family: YakuHanJP, "游ゴシック", "Yu Gothic", YuGothic, "メイリオ", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", "Lucida Grande", "Osaka","Verdana", "MS Pゴシック", sans-serif;
  font-feature-settings: "palt";
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
}

a {
  color: #000;
  text-decoration: none;
}

img {
  -webkit-backface-visibility: hidden;
  max-width: 100%;
}

button {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

body {
  background: linear-gradient(150deg, #ffffff 0%, #dbdae5 40%);
  /* background: #dbdae5; */
  
}
main {
  max-width: 76rem;
  margin: 0 auto;
  padding-top: 10rem;
}
.l-accordion_container {
  max-width: 40rem;
  border-radius: 3rem;
  background: #e7e6f2;
  box-shadow: 2.2rem 2.2rem 4.5rem #cfced9,
  -2.2rem -2.2rem 4.5rem #f3f2ff;
  margin: 0 auto 4rem;
}

.l-accordion_container_btn {
  width: 100%;
  position: relative;
  display: block;
  padding: 2rem 3rem;
  border-radius: 3rem 3rem 0 0;
  font-family: 'Inter',
  sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: #555559;
  text-align: left;
}

.l-accordion_container_btn::before,
.l-accordion_container_btn::after {
  position: absolute;
  top: 50%;
  right: 3rem;
  content: "";
  width: 2rem;
  height: .2rem;
  background: #555559;
  transform: translateY(-50%);
}
.l-accordion_container_btn::after {
  transform: translateY(-50%) rotate(90deg);
  transition: transform .45s ease, opacity .45s ease;
}

.l-accordion_container_btn.is-active {

}
.l-accordion_container_btn.is-active::after {
  opacity: 0;
  transform: translateY(-50%) rotate(0);
}

.l-accordion_content {
  height: 0;
  overflow: hidden;
  transition: height .45s ease;
}

.l-accordion_content_txt {
  padding: 0 3rem 2rem;
  font-size: 1.4rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: #555559;
}

              
            
!

JS

              
                Vue.component('accordion', {
  template: `
  <article class="l-accordion_container js-accordion">
    <h2 class="l-accordion_container_ttl"><button class="l-accordion_container_btn js-accordion_btn" @click="accordionBtn">
      <slot name="accordion-btn-txt"></slot>
    </button></h2>
    <div class="l-accordion_content js-accordion_item_wrapper">
      <div class="l-accordion_content_wrapper js-accordion_item">
        <p class="l-accordion_content_txt"><slot name="accrdion-content"></slot></p>
      </div>
    </div>
  </article>`,
  methods: {
    accordionBtn: function(e) {
        var contentHeight = this.$el.querySelector('.js-accordion_item').clientHeight
        
        if(!this.$el.querySelector('.js-accordion_item_wrapper').clientHeight) {
          this.$el.querySelector('.js-accordion_item_wrapper').style.height = `${contentHeight}px`
        } else {
          this.$el.querySelector('.js-accordion_item_wrapper').style.height = 0
        }
        
        e.currentTarget.classList.toggle('is-active');
      }
  }
})

new Vue({ el: '#app' })
              
            
!
999px

Console