×

注意!页面内容来自https://qiita.com/nishino-m/items/127ccc6f607823864b7c,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页

< data-emotion="-global xgff9b">.-xgff9b{height:32px;}< data-emotion="-global ffh7zq">.-ffh7zq{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:56px;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;padding:16px 24px 0;}@media (max-width: 1199px){.-ffh7zq{gap:24px;}}@media (max-width: 769px){.-ffh7zq{padding:16px 16px 0;}}@media (max-width: 479px){.-ffh7zq{padding:16px 0 0;}}< data-emotion="-global 1hl01qi">.-1hl01qi{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:16px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;position:-webkit-sticky;position:sticky;top:40px;z-index:5;}@media (max-width: 769px){.-1hl01qi{display:none;}}< data-emotion="-global c1wjhj">.-c1wjhj{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:0;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}< data-emotion="-global 1duml6f">.-1duml6f{height:40px;width:40px;position:relative;}.-1duml6f svg{cursor:auto;pointer-events:none;}< data-emotion="-global ftns26">.-ftns26{fill:none;left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%-50%);-moz-transform:translate(-50%-50%);-ms-transform:translate(-50%-50%);transform:translate(-50%-50%);}.-ftns26 .circle,.-ftns26 .heart-stroke,.-ftns26 .heart-fill,.-ftns26 .particle{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;transform-origin:center center;}.-ftns26 .circle{fill:var(--color-surface);stroke:var(--color-divider);stroke-width:1;}.-ftns26 .heart-stroke{fill:var(--color-mediumEmphasis);}.-ftns26 .heart-fill{fill:var(--color-qiitaGreen);opacity:0;}.-ftns26 .particles{rotate:var(--rotate);transform-origin:center center;}.-ftns26 .particle{opacity:0;}.-ftns26.liked .circle{-webkit-animation-delay:90ms;animation-delay:90ms;-webkit-animation-duration:60ms;animation-duration:60ms;-webkit-animation-name:animation-1n63bow;animation-name:animation-1n63bow;}.-ftns26.liked .heart-stroke{-webkit-animation-duration:150ms;animation-duration:150ms;-webkit-animation-name:animation-d4tj02;animation-name:animation-d4tj02;}.-ftns26.liked .heart-fill{-webkit-animation-delay:150ms;animation-delay:150ms;-webkit-animation-duration:100ms;animation-duration:100ms;-webkit-animation-name:animation-19addpb;animation-name:animation-19addpb;}.-ftns26.liked .particle{-webkit-animation-delay:150ms;animation-delay:150ms;-webkit-animation-duration:var(--duration);animation-duration:var(--duration);-webkit-animation-name:animation-1spcwjj;animation-name:animation-1spcwjj;}< data-emotion="-global animation-1spcwjj">@-webkit-keyframes animation-1spcwjj{1%{opacity:1;}90%{opacity:1;}100%{cx:var(--x);cy:var(--y);opacity:0;}}@keyframes animation-1spcwjj{1%{opacity:1;}90%{opacity:1;}100%{cx:var(--x);cy:var(--y);opacity:0;}}< data-emotion="-global animation-19addpb">@-webkit-keyframes animation-19addpb{1%{scale:1.2;opacity:1;}100%{scale:1;opacity:1;}}@keyframes animation-19addpb{1%{scale:1.2;opacity:1;}100%{scale:1;opacity:1;}}< data-emotion="-global animation-d4tj02">@-webkit-keyframes animation-d4tj02{40%{fill:currentColor;scale:0.85;}100%{fill:var(--color-qiitaGreen);}}@keyframes animation-d4tj02{40%{fill:currentColor;scale:0.85;}100%{fill:var(--color-qiitaGreen);}}< data-emotion="-global animation-1n63bow">@-webkit-keyframes animation-1n63bow{100%{stroke:var(--color-qiitaGreen);}}@keyframes animation-1n63bow{100%{stroke:var(--color-qiitaGreen);}}< data-emotion="-global 10ttvi6">.-10ttvi6{background-color:transparent;border:none;cursor:pointer;height:40px;padding:0;position:absolute;width:40px;}.-10ttvi6:disabled{cursor:not-allowed;}< data-emotion="-global wknrvb">@media (max-width: 769px){.-wknrvb{display:block;}}< data-emotion="-global 3fim88">.-3fim88{position:relative;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}< data-emotion="-global 1a6dkvp">.-1a6dkvp{color:var(--color-mediumEmphasis);cursor:pointer;font-size:var(--font-size-body-2);font-weight:bold;}< data-emotion="-global wvpanj">.-wvpanj{background-color:var(--color-grayContainer);border-radius:4px;color:var(--color-onContainerText);font-size:var(--font-size-body-3);max-width:280px;overflow-wrap:break-word;padding:4px 8px;position:absolute;pointer-events:none;display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;z-index:1;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:calc(100% + 0px + 4px);}.-wvpanj::after{background-color:var(--color-grayContainer);content:"";position:absolute;}< data-emotion="-global 1bc9a2c">.-1bc9a2c{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:0;position:relative;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}< data-emotion="-global 100tu0r">.-100tu0r{display:inline-block;fill:var(--color-mediumEmphasis);height:24px;width:24px;}< data-emotion="-global 1vem4tk">.-1vem4tk{color:var(--color-mediumEmphasis);font-size:14px;font-weight:bold;}@media (max-width: 769px){.-1vem4tk{display:inline;}}< data-emotion="-global 1n9ulpr">.-1n9ulpr{border:none;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background-color:transparent;border:none;color:var(--color-mediumEmphasis);cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:20px;height:32px;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;padding:0;width:32px;}< data-emotion="-global 1b1cd5z">.-1b1cd5z{height:20px;fill:var(--color-twitter);width:20px;}< data-emotion="-global 1qsoaul">.-1qsoaul{background-color:var(--color-grayContainer);border-radius:4px;color:var(--color-onContainerText);font-size:var(--font-size-body-3);max-width:280px;overflow-wrap:break-word;padding:4px 8px;position:absolute;pointer-events:none;display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;z-index:1;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:calc(100% + -4px + 4px);}.-1qsoaul::after{background-color:var(--color-grayContainer);content:"";position:absolute;}< data-emotion="-global 157xj1g">.-157xj1g{height:20px;fill:#1877f2;width:20px;}< data-emotion="-global 1uu7u3w">.-1uu7u3w{height:20px;width:20px;}< data-emotion="-global 79elbk">.-79elbk{position:relative;}< data-emotion="-global v2p563">.-v2p563{display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:24px;height:24px;overflow:hidden;width:24px;}< data-emotion="-global oi42s2">.-oi42s2:modal{background-color:transparent;border:none;max-height:none;max-width:none;width:100%;height:100dvh;display:grid;place-items:center;padding:16px;}.-oi42s2::backdrop{background-color:rgb(0 0 0 / .32);}< data-emotion="-global 2aaf4j">.-2aaf4j{background-color:var(--color-surface);border-radius:8px;color:var(--color-highEmphasis);max-width:600px;max-height:calc(100vh - 160px);overflow-y:auto;padding:24px;width:100%;scrollbar-width:thin;scrollbar-color:var(--scrollbar-color-scrollbarThumb) transparent;}.-2aaf4j::-webkit-scrollbar{width:8px;}.-2aaf4j::-webkit-scrollbar-track{background:transparent;}.-2aaf4j::-webkit-scrollbar-thumb{background:var(--scrollbar-color-scrollbarThumb);border-radius:4px;}< data-emotion="-global bxc62b">.-bxc62b{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid var(--color-divider);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;padding-bottom:8px;}< data-emotion="-global 1snuvpu">.-1snuvpu{font-size:var(--font-size-subhead-2);font-weight:600;line-height:1.4;}< data-emotion="-global o8tyjw">.-o8tyjw{background-color:transparent;color:var(--color-mediumEmphasis);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:4px;}< data-emotion="-global 6vdptm">.-6vdptm{font-size:var(--font-size-body-1);margin-top:16px;}< data-emotion="-global 111ab2g">.-111ab2g{border-top:1px solid var(--color-divider);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;margin-top:16px;padding-top:16px;}< data-emotion="-global hreeih">.-hreeih{border-radius:8px;box-sizing:border-box;cursor:pointer;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:16px;font-weight:600;line-height:1.8;margin-bottom:0;min-height:34px;min-width:64px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;-webkit-transition:.1s ease-out;transition:.1s ease-out;transition-property:background-color,border-color;background-color:var(--color-surface);border:1px solid var(--color-grayBorder);color:var(--color-grayText);padding:3px 15px;}.-hreeih:disabled{box-shadow:none;cursor:not-allowed;opacity:0.32;}.-hreeih:active{background-color:var(--color-background);}@media (hover: hover) and (pointer: fine){.-hreeih:hover{background-color:var(--color-background);}}< data-emotion="-global y54waz">.-y54waz{border-radius:8px;box-sizing:border-box;cursor:pointer;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:16px;font-weight:600;line-height:1.8;margin-bottom:0;min-height:34px;min-width:64px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;-webkit-transition:.1s ease-out;transition:.1s ease-out;transition-property:background-color,border-color;background-color:var(--color-redContainer);color:var(--color-onContainerText);padding:4px 16px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:4px;}.-y54waz:disabled{box-shadow:none;cursor:not-allowed;opacity:0.32;}.-y54waz:active{background-color:var(--color-redContainerDim);}@media (hover: hover) and (pointer: fine){.-y54waz:hover{background-color:var(--color-redContainerDim);}}< data-emotion="-global 1jvcm2e">.-1jvcm2e{display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:16px;height:16px;overflow:hidden;width:16px;}< data-emotion="-global 1hbd3g7">.-1hbd3g7{height:250px;}< data-emotion="-global uaiz0z">.-uaiz0z{height:90px;margin-bottom:32px;}@media (max-width: 1227px){.-uaiz0z{height:50px;}}@media (max-width: 769px){.-uaiz0z{display:none;}}< data-emotion="-global itrjxe">.-itrjxe{background-color:var(--color-surface);border-radius:8px;padding:32px 56px;margin-bottom:24px;}@media (max-width: 769px){.-itrjxe{padding:24px 32px;}}@media (max-width: 479px){.-itrjxe{border-radius:0;margin:0 0 40px;padding:24px 16px;}}< data-emotion="-global 8qb8m4">.-8qb8m4{margin-bottom:48px;}< data-emotion="-global 1yndj8s">.-1yndj8s{display:grid;gap:8px;margin-bottom:16px;}< data-emotion="-global i43zkt">.-i43zkt{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:var(--font-size-body-2);gap:0 8px;line-height:var(--line-height-body);width:100%;}< data-emotion="-global 17gh4w8">.-17gh4w8{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:0 8px;width:calc(100% - 40px);}< data-emotion="-global mavs84">.-mavs84{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--color-highEmphasis);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:var(--font-size-body-1);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;}< data-emotion="-global kcbbwa">.-kcbbwa{border-radius:50%;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;overflow:hidden;position:relative;width:24px;height:24px;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;margin-right:8px;}.-kcbbwa::before{background-color:var(--color-gray0);border-radius:50%;content:"";height:23px;left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%-50%);-moz-transform:translate(-50%-50%);-ms-transform:translate(-50%-50%);transform:translate(-50%-50%);width:23px;}< data-emotion="-global 1wqqt93">.-1wqqt93{display:block;height:24px;object-fit:contain;position:relative;width:24px;}< data-emotion="-global 15fzge">.-15fzge{margin-left:4px;}< data-emotion="-global wo2a1i">.-wo2a1i{font-size:28px;font-weight:600;line-height:var(--line-height-headline);margin-top:8px;word-break:break-all;}< data-emotion="-global 28f073">.-28f073{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:4px;margin-top:16px;}< data-emotion="-global 19h8hex">.-19h8hex{background-color:var(--color-surfaceVariant);border-radius:4px;color:var(--color-mediumEmphasis);display:block;font-size:var(--font-size-body-2);line-height:var(--line-height-body-dense);padding:0 6px;position:relative;z-index:1;}.-19h8hex:active{-webkit-text-decoration:none;text-decoration:none;background-color:var(--color-surfaceVariantDim);}@media (hover: hover) and (pointer: fine){.-19h8hex:hover{-webkit-text-decoration:none;text-decoration:none;background-color:var(--color-surfaceVariantDim);}}< data-emotion="-global 1npej5s">.-1npej5s{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;font-size:var(--font-size-body-2);gap:0 8px;margin-top:8px;}< data-emotion="-global 1r3vbu3">.-1r3vbu3{display:grid;gap:24px;margin-top:32px;}< data-emotion="-global gg4vpm">.-gg4vpm{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;}< data-emotion="-global 1f18zs1">.-1f18zs1{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:16px;}< data-emotion="-global aaiy04">.-aaiy04{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:4px;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}< data-emotion="-global buogjo">@media (max-width: 769px){.-buogjo{display:none;}}< data-emotion="-global yz0xtg">.-yz0xtg{background-color:var(--color-grayContainer);border-radius:4px;color:var(--color-onContainerText);font-size:var(--font-size-body-3);max-width:280px;overflow-wrap:break-word;padding:4px 8px;position:absolute;pointer-events:none;display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;z-index:1;bottom:calc(100% + 0px + 4px);left:50%;-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);}.-yz0xtg::after{background-color:var(--color-grayContainer);content:"";position:absolute;}< data-emotion="-global izmm4j">.-izmm4j{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;gap:4px;position:relative;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}< data-emotion="-global 1129w32">.-1129w32{color:var(--color-mediumEmphasis);font-size:14px;font-weight:bold;}@media (max-width: 769px){.-1129w32{display:none;}}< data-emotion="-global tzv11m">.-tzv11m{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:4px;color:var(--color-highEmphasis);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:var(--font-size-body-2);gap:4px;padding:0 4px;}.-tzv11m:active{background-color:var(--color-surfaceVariant);-webkit-text-decoration:none;text-decoration:none;}@media (hover: hover) and (pointer: fine){.-tzv11m:hover{background-color:var(--color-surfaceVariant);-webkit-text-decoration:none;text-decoration:none;}}< data-emotion="-global n5k90r">.-n5k90r{display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:16px;height:16px;overflow:hidden;width:16px;color:var(--color-mediumEmphasis);}< data-emotion="-global rwy56f">.-rwy56f{background-image:url(//cdn.qiita.com/assets/public/image-qiitan_for_login_modal-014e085d3e40a240e3fe8d61b70b29a9.png);-webkit-background-position:bottom 24px right 24px;background-position:bottom 24px right 24px;background-repeat:no-repeat;-webkit-background-size:140px;background-size:140px;border:1px solid var(--color-greenBorder);border-radius:8px;margin:40px auto 0;max-width:572px;padding:24px;}@media (max-width: 769px){.-rwy56f{width:100%;background-image:none;}}< data-emotion="-global 1nyasl8">.-1nyasl8{font-size:var(--font-size-subhead-1);font-weight:600;line-height:1.4;}@media (max-width: 769px){.-1nyasl8{font-size:var(--font-size-subhead-2);}}< data-emotion="-global 1i89dtz">.-1i89dtz{font-size:var(--font-size-body-1);font-weight:600;list--position:inside;margin-top:16px;}@media (max-width: 769px){.-1i89dtz{font-size:var(--font-size-body-2);}}< data-emotion="-global dzaums">.-dzaums{display:inline-block;font-size:var(--font-size-body-2);margin-top:16px;-webkit-text-decoration:underline;text-decoration:underline;}< data-emotion="-global geahq7">.-geahq7{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:16px;margin-top:16px;}@media (max-width: 769px){.-geahq7{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}}< data-emotion="-global 1dq3d3h">.-1dq3d3h{border-radius:8px;box-sizing:border-box;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:16px;font-weight:600;line-height:1.8;min-height:34px;min-width:64px;opacity:1;pointer-events:auto;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;-webkit-transition:.1s ease-out;transition:.1s ease-out;transition-property:background-color,border-color;background-color:var(--color-greenContainer);color:var(--color-onContainerText);padding:4px 16px;gap:16px;}.-1dq3d3h:hover{-webkit-text-decoration:none;text-decoration:none;}.-1dq3d3h:active{background-color:var(--color-greenContainerDim);}@media (hover: hover) and (pointer: fine){.-1dq3d3h:hover{background-color:var(--color-greenContainerDim);}}@media (max-width: 769px){.-1dq3d3h{width:100%;}}< data-emotion="-global tfrxbl">.-tfrxbl{border-radius:8px;box-sizing:border-box;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:16px;font-weight:600;line-height:1.8;min-height:34px;min-width:64px;opacity:1;pointer-events:auto;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;-webkit-transition:.1s ease-out;transition:.1s ease-out;transition-property:background-color,border-color;background-color:var(--color-surface);border:1px solid var(--color-grayBorder);color:var(--color-grayText);padding:3px 15px;gap:16px;}.-tfrxbl:hover{-webkit-text-decoration:none;text-decoration:none;}.-tfrxbl:active{background-color:var(--color-background);}@media (hover: hover) and (pointer: fine){.-tfrxbl:hover{background-color:var(--color-background);}}@media (max-width: 769px){.-tfrxbl{width:100%;}}< data-emotion="-global 1395ble">.-1395ble{background-color:var(--color-background);bottom:0;box-shadow:0px 1px 1px 0px rgba(3033330.25),0px 0px 0px 1px var(--elevation-color-elevationDivider);display:none;height:calc(env(safe-area-inset-bottom0px) + 56px);-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;padding-bottom:env(safe-area-inset-bottom0px);position:fixed;width:100%;z-index:1000;}@media (max-width: 769px){.-1395ble{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}< data-emotion="-global 5jpx49">.-5jpx49{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:space-evenly;-ms-flex-pack:space-evenly;-webkit-justify-content:space-evenly;justify-content:space-evenly;width:100%;}< data-emotion=" 1xwfn2v 1o9h1hg 1vr7y3r 3k9iaf">.-1xwfn2v{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background-color:var(--color-surface);border:1px solid var(--color-divider);border-radius:50%;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:40px;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:40px;}.-1o9h1hg{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background-color:transparent;border:none;color:var(--color-mediumEmphasis);cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:20px;height:32px;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;padding:0;width:32px;}.-1vr7y3r{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:50%;color:var(--color-mediumEmphasis);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:var(--font-size-subhead-1);height:32px;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;padding:0;width:32px;}.-3k9iaf{color:var(--color-mediumEmphasis);}< data-emotion="-global 1736035">.-1736035{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:var(--font-size-body-2);font-weight:600;list-:none;max-width:1656px;overflow-x:auto;padding:0 32px;width:100%;scrollbar-width:thin;scrollbar-color:var(--scrollbar-color-scrollbarThumb) transparent;}.-1736035::-webkit-scrollbar{height:8px;}.-1736035::-webkit-scrollbar-track{background:transparent;}.-1736035::-webkit-scrollbar-thumb{background:var(--scrollbar-color-scrollbarThumb);border-radius:4px;}@media (max-width: 769px){.-1736035{padding:0 16px;}}< data-emotion="-global 1cnt4b8">.-1cnt4b8{background-color:var(--color-surface);}< data-emotion="-global ymuwam">.-ymuwam{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;margin:auto;max-width:1656px;padding:8px 32px 0;width:100%;}@media (max-width: 769px){.-ymuwam{padding:8px 16px 0;}}< data-emotion="-global fv3lde">.-fv3lde{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}< data-emotion="-global 1etvg7j">.-1etvg7j{background-color:var(--color-qiitaGreen);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:6px 10px;border-radius:4px;}.-1etvg7j >svg{fill:var(--color-gray0);height:18px;}< data-emotion="-global 68a7fl">.-68a7fl{margin-right:12px;position:relative;width:320px;}@media (max-width: 991px){.-68a7fl{display:none;}}< data-emotion="-global 18lpml7">.-18lpml7{display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:16px;height:16px;overflow:hidden;width:16px;color:var(--color-mediumEmphasis);left:8px;position:absolute;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}< data-emotion="-global 1gmi769">.-1gmi769{background-color:var(--color-surfaceVariant);border:none;border-radius:8px;color:var(--color-highEmphasis);font-size:var(--font-size-body-1);line-height:var(--line-height-body);padding:4px 8px 4px 32px;width:100%;}.-1gmi769::-webkit-input-placeholder{color:var(--color-disabled);}.-1gmi769::-moz-placeholder{color:var(--color-disabled);}.-1gmi769:-ms-input-placeholder{color:var(--color-disabled);}.-1gmi769::placeholder{color:var(--color-disabled);}.-1gmi769::-webkit-search-cancel-button{-webkit-appearance:none;}< data-emotion="-global 17ja8a3">.-17ja8a3{display:none;}@media (max-width: 991px){.-17ja8a3{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:inherit;color:var(--color-mediumEmphasis);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:var(--font-size-body-1);-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;padding:10px;}}.-17ja8a3:active{color:var(--color-highEmphasis);}@media (hover: hover) and (pointer: fine){.-17ja8a3:hover{color:var(--color-highEmphasis);}}< data-emotion="-global v2p563">.-v2p563{display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:24px;height:24px;overflow:hidden;width:24px;}< data-emotion="-global 1afofdy">.-1afofdy{-webkit-transform:scale(0,0);-moz-transform:scale(0,0);-ms-transform:scale(0,0);transform:scale(0,0);position:absolute;}< data-emotion="-global 1sn73cs">.-1sn73cs{border-radius:8px;box-sizing:border-box;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:14px;font-weight:600;line-height:1.8;min-height:34px;min-width:64px;opacity:1;pointer-events:auto;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;-webkit-transition:.1s ease-out;transition:.1s ease-out;transition-property:background-color,border-color;background-color:var(--color-surface);border:1px solid var(--color-greenBorder);color:var(--color-greenText);padding:3px 15px;margin-left:4px;}.-1sn73cs:hover{-webkit-text-decoration:none;text-decoration:none;}.-1sn73cs:active{background-color:var(--color-background);}@media (hover: hover) and (pointer: fine){.-1sn73cs:hover{background-color:var(--color-background);}}< data-emotion="-global 1r635es">.-1r635es{border-radius:8px;box-sizing:border-box;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:14px;font-weight:600;line-height:1.8;min-height:34px;min-width:64px;opacity:1;pointer-events:auto;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;-webkit-transition:.1s ease-out;transition:.1s ease-out;transition-property:background-color,border-color;background-color:var(--color-greenContainer);color:var(--color-onContainerText);padding:4px 16px;margin-left:8px;}.-1r635es:hover{-webkit-text-decoration:none;text-decoration:none;}.-1r635es:active{background-color:var(--color-greenContainerDim);}@media (hover: hover) and (pointer: fine){.-1r635es:hover{background-color:var(--color-greenContainerDim);}}< data-emotion="-global o5vc">.-o5vc{display:none;margin:8px auto 0;width:calc(100vw - 32px);position:relative;}< data-emotion="-global 1l4w6pd">.-1l4w6pd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}< data-emotion="-global yqetlk">.-yqetlk{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--color-mediumEmphasis);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:2px;position:relative;white-space:nowrap;padding:4px 12px;margin:4px 0;}.-yqetlk:hover{background-color:var(--color-surfaceVariant);border-radius:4px;color:var(--color-highEmphasis);-webkit-text-decoration:none;text-decoration:none;}< data-emotion="-global 1o3zxqp">.-1o3zxqp{display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;font-size:16px;height:16px;overflow:hidden;width:16px;margin-left:4px;}< data-emotion=" ">< data-emotion=" ">< data-emotion="-global 1geho0x">.-1geho0x{color:var(--color-gray0);background-color:var(--color-gray90);display:grid;grid-template-columns:minmax(01592px);-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;margin-top:64px;padding:48px 32px;width:100%;}@media (max-width: 991px){.-1geho0x{padding-inline:16px;}}< data-emotion="-global 1vesoht">.-1vesoht{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;}@media (max-width: 1199px){.-1vesoht{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}}< data-emotion="-global 1xygyrj">.-1xygyrj{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;margin-right:48px;}< data-emotion="-global j7qw">.-j7qw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}< data-emotion="-global 1g0k1wk">.-1g0k1wk{fill:var(--color-gray0);}< data-emotion="-global 754ift">.-754ift{font-size:var(--font-size-body-2);margin-top:16px;}< data-emotion="-global 120vwzo">.-120vwzo{font-size:var(--font-size-body-3);}@media (max-width: 1199px){.-120vwzo{margin-top:24px;}}< data-emotion="-global 15fzge">.-15fzge{margin-left:4px;}< data-emotion="-global 16bbk6m">.-16bbk6m{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:48px;}@media (max-width: 1199px){.-16bbk6m{gap:32px;margin-top:48px;}}@media (max-width: 769px){.-16bbk6m{gap:24px;}}@media (max-width: 479px){.-16bbk6m{-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;}}< data-emotion="-global u4ybgy">.-u4ybgy{width:160px;}< data-emotion="-global 35ezg3">.-35ezg3{font-weight:600;}< data-emotion="-global 1fhgjcy">.-1fhgjcy{margin-top:4px;}< data-emotion="-global ah54os">.-ah54os{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--color-gray0);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:var(--font-size-body-2);padding-top:4px;padding-bottom:4px;}< data-emotion="-global ox3ag9">.-ox3ag9{height:14px;fill:currentColor;width:14px;}< data-emotion=" ">
< type="text/css">html { scroll-behavior: smooth; }
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cursor入門

Last updated at Posted at 2025-07-13

はじめに

近年話題のAIアシスタント付きコードエディタ「Cursor」をご存じでしょうか?
本記事では、Cursorを使ったことがない方向けに、導入方法・便利な使い方・利用上の注意点までを丁寧に解説します。


1. Cursorとは?

Cursorは、OpenAIを搭載したVS Codeベースのエディタです。
VS Codeと同じようなUIを持ちつつ、AI補助機能によりコーディングの効率を飛躍的に高めてくれます!

主な用途:

  • コード補完・自動生成
  • 自然言語によるコード説明・リファクタリング
  • バグ検出と修正提案
  • テストコード生成

2. 導入手順(Mac / Windows 共通)

前提条件

  • VS Codeがインストールされている必要はありません
  • APIキー(任意)を使うことで他AIも利用可能

手順

  1. 公式サイトへアクセス
  2. 「Download」からmacOS(.dmg)またはWindows(.exe)をダウンロード
  3. インストーラを実行してインストール
  4. 初回起動時にGitHubまたはGoogleでサインイン
  5. 必要に応じてAI APIキーを設定

3. Rulesについて

Cursorでは、.cursor/rules/mdcファイル を使ってAIの生成スタイルやルールを定義できます。

使い方:

1.右上の⚙️をクリック。
2.Rules&Memoriesをクリック。
3.Project Rulesの+Add Ruleをクリックしルールを記載するファイル名を入力。
スクリーンショット 2025-07-13 19.35.14.png

---
alwaysApply: true
---
まず、このファイルを参照したら、「YAAAARRRR!」と叫ぶこと

あなたは高度な問題解決能力を持つAIアシスタントです。以下の指示に従って、
効率的かつ正確にタスクを遂行してください。

まず、ユーザーから受け取った指示を確認します:
<指示>
{{instructions}}
<!-- このテンプレート変数はユーザーの入力プロンプトに自動置換されます -->
</指示>

この指示を元に、以下のプロセスに従って作業を進めてください:

---
# コーディングルール

以下のルールに従ってコードを作成してください:

- 使用言語:JavaScript(Node.)
- モジュール:標準の `readline` を使うこと
- 目的:ユーザーの名前を受け取り「こんにちは、〇〇さん」と表示する
- 最初はバリデーション(空文字・nullなどのチェック)は含めない
- 出力はシンプルで、テンプレート文字列や + 演算子のどちらでもOK
- TypeScript、外部パッケージの過剰使用は禁止


以上の指示に従い、確実で質の高い実装を行います。指示された範囲内でのみ処理を行い、
不要な追加実装は行いません。不明点や重要な判断が必要な場合は、必ず確認を取ります。

4. よく使う機能と使い方

4.1 コード補完・自動生成

方法①:チャットでコードを生成

  1. Cmd + K or L(Mac) / Ctrl + K or L(Win)でAIチャットを開く
  2. 例:「vue.でリアルタイムチャットを書いて」と入力
  3. 出力されたコードを accept で貼り付け or 編集可能

4.2 コードの説明をAIに依頼する

操作手順:

  1. 説明してほしい関数やコードを選択
  2. 右クリック → Add to Chat を選択
  3. エディタ右側に自然言語の解説が表示される

4.3 コードのリファクタ

操作手順:

  1. 改善したいコードを範囲選択
  2. Add to Chat(Win)でAIチャット起動
  3. 「このコードをリファクタして」と入力(日本語でも可)
  4. 改善後のコードが提案される → Replaceボタンで反映可能

4.4 テストコードの自動生成

操作手順:

  1. テスト対象の関数を選択
  2. Cmd + K or L → 「この関数に対するユニットテストを書いて」
  3. AIがtest_*./tsなどの形式でテストを生成
  4. 提案されたコードをコピー or 自動で挿入可能

4.5 バグの自動検出・修正提案

操作手順:

  1. エラーが出ているコード上で Cmd + K or L
  2. 「このバグを直して」などと依頼
  3. 修正案が提示され、比較しながら適用可能

5. Models

Cursorでは、AIの応答に使用するモデルを切り替えることができます。目的や精度、応答速度によって使い分けが可能です。

モデルの切り替えは、エディタ右下のモデル名をクリック、または Settings > Model から行えます。

6. MCP

MCPとは?
外部サービスとCursorを紐付けることができる機能です。

7. 参考リンク


5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?