パーツ番号 09-07-01 ・ CSSのみ
成功/情報/警告/エラー4色アラートセット(静止)
4種類の状態を色分けした静止アラート一覧。フォーム送信結果やシステム通知の表示パターン整理に使える。
プレビュー
ソースコード
HTML
<div class="alertset09-07-01">
<div class="al a-success">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"></circle><path d="M8 12l2.5 2.5L16 9"></path></svg>
<span>操作が正常に完了しました</span>
</div>
<div class="al a-info">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"></circle><line x1="12" y1="11" x2="12" y2="16"></line><circle cx="12" cy="7.5" r="1"></circle></svg>
<span>新しいお知らせがあります</span>
</div>
<div class="al a-warning">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 4l9 16H3z"></path><line x1="12" y1="10" x2="12" y2="14"></line><circle cx="12" cy="17" r="1"></circle></svg>
<span>入力内容をご確認ください</span>
</div>
<div class="al a-error">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"></circle><line x1="9" y1="9" x2="15" y2="15"></line><line x1="15" y1="9" x2="9" y2="15"></line></svg>
<span>エラーが発生しました</span>
</div>
</div>CSS
.d09-07-01 .alertset09-07-01{
display:flex;
flex-direction:column;
gap:8px;
width:100%;
max-width:280px;
font-family:sans-serif;
}
.d09-07-01 .al{
display:flex;
align-items:center;
gap:8px;
padding:8px 10px;
border-radius:6px;
border-left:4px solid;
font-size:12.5px;
line-height:1.4;
}
.d09-07-01 .al svg{
width:15px;
height:15px;
flex-shrink:0;
}
.d09-07-01 .a-success{
background:#dcfce7;
border-color:#16a34a;
color:#166534;
}
.d09-07-01 .a-info{
background:#dbeafe;
border-color:#2563eb;
color:#1e40af;
}
.d09-07-01 .a-warning{
background:#fef3c7;
border-color:#d97706;
color:#92400e;
}
.d09-07-01 .a-error{
background:#fee2e2;
border-color:#dc2626;
color:#991b1b;
}クラス名 .d09-07-01 は本ライブラリ内での識別用です。複数のパーツを同じページで使う場合は、重複しないよう名前を変更してください。