सामग्री पर जाएँ
अनुभाग
Fiesta

scheme-menu

रूट वे टुकड़े जो पूरा उत्तर हैं, किसी उत्तर का हिस्सा नहीं।

"हल्का", "गहरा" और "सिस्टम" के लिए तीन आइकन बटन। हर एक एक-फ़ील्ड वाला POST फ़ॉर्म भेजता है। चुनाव आपका ऐप संभालता है; अकेले इस्तेमाल करने पर fiesta.js उसे ब्राउज़र में याद रखता है।

हर उदाहरण असली है, पर उसके लिंक कहीं नहीं ले जाते। HTML कॉपी करने के लिए मार्कअप दिखाता है।

तीन आइकन, गहरा चुना हुआ।

हर रंग योजना एक-फ़ील्ड वाला फ़ॉर्म है। एक चुनने पर आपके ऐप को POST जाता है, और पेज चुनी हुई योजना को मौजूदा के रूप में चिह्नित करके लौटता है।

पूर्वावलोकन
<footer rst-page-foot>
  <div rst-scheme="icons" role="group" aria-label="दिखावट">
    <form method="post" action="/_theme">
      <input type="hidden" name="scheme" value="light">
      <input type="hidden" name="return" value="/">
      <button type="submit" aria-label="हल्का">
        <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>
      </button>
    </form>
    <form method="post" action="/_theme">
      <input type="hidden" name="scheme" value="dark">
      <input type="hidden" name="return" value="/">
      <button type="submit" aria-label="गहरा" aria-current="true">
        <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/></svg>
      </button>
    </form>
    <form method="post" action="/_theme">
      <input type="hidden" name="scheme" value="system">
      <input type="hidden" name="return" value="/">
      <button type="submit" aria-label="सिस्टम">
        <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/></svg>
      </button>
    </form>
  </div>
</footer>

किसी ऐप में यह /_theme तक पहुँचता। यहाँ इसके लिंक और फ़ॉर्म कहीं नहीं जाते।

खाता कार्ड के अंदर

खाता कार्ड में "दिखावट" की एक पंक्ति और "भाषा" की एक पंक्ति है। रंग योजना चुनने पर वह वहीं लागू हो जाती है और कार्ड खुला रहता है।

पूर्वावलोकन
<header rst-shell-bar>
  <details rst-dropdown rst-shell-account name="rst-shell-menu" open>
    <summary>
      <span rst-shell-avatar>
        <span rst-person-av aria-hidden="true">G</span>
        <span rst-person-name>Grace Hopper</span>
        <span rst-person-email>grace@example.com</span>
      </span>
      <span rst-shell-account-label>खाता</span>
      <span rst-caret aria-hidden="true">
        <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
      </span>
    </summary>
    <div rst-dropdown-menu>
      <div rst-shell-who>
        <span rst-person-av aria-hidden="true">G</span>
        <span rst-person-name>Grace Hopper</span>
        <span rst-person-email>grace@example.com</span>
      </div>
      <div rst-menu-row>
        <span rst-menu-row-label>दिखावट</span>
        <div rst-scheme="icons" role="group" aria-label="दिखावट">
          <form method="post" action="/_theme">
            <input type="hidden" name="scheme" value="light">
            <input type="hidden" name="return" value="/">
            <button type="submit" aria-label="हल्का">
              <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>
            </button>
          </form>
          <form method="post" action="/_theme">
            <input type="hidden" name="scheme" value="dark">
            <input type="hidden" name="return" value="/">
            <button type="submit" aria-label="गहरा" aria-current="true">
              <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/></svg>
            </button>
          </form>
          <form method="post" action="/_theme">
            <input type="hidden" name="scheme" value="system">
            <input type="hidden" name="return" value="/">
            <button type="submit" aria-label="सिस्टम">
              <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/></svg>
            </button>
          </form>
        </div>
      </div>
      <div rst-menu-row>
        <span rst-menu-row-label>भाषा</span>
    <button type="button" popovertarget="rst-language">
          <span lang="en">English</span><span rst-caret aria-hidden="true">
            <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
          </span>
        </button>
        <details rst-dropdown name="rst-menus">
          <summary>
            <span lang="en">English</span>
            <span rst-caret aria-hidden="true">
              <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
            </span>
          </summary>
        </details>
        <div rst-locale popover id="rst-language">
          <div rst-menu-row>
            <h2>भाषा</h2>
            <button type="button" popovertarget="rst-language" popovertargetaction="hide">बंद करें</button>
          </div>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="en">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="en" aria-current="true">English</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="ga">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="ga">Gaeilge</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="zh-Hans">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="zh-Hans">简体中文</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="es">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="es">Español</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="hi">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="hi">हिन्दी</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="pt-PT">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="pt-PT">Português</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="bn">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="bn">বাংলা</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="ru">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="ru">Русский</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="ja">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="ja">日本語</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="yue">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="yue">廣東話</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="vi">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="vi">Tiếng Việt</button>
          </form>
          <form method="post" action="/_locale">
            <input type="hidden" name="locale" value="ar">
            <input type="hidden" name="return" value="/">
            <button type="submit" lang="ar">العربية</button>
          </form>
        </div>
      </div>
      <a href="/settings">सेटिंग</a>
      <a href="/sign-out">साइन आउट करें</a>
    </div>
  </details>
</header>

किसी ऐप में यह /_locale, /_theme, /settings, /sign-out तक पहुँचता। यहाँ इसके लिंक और फ़ॉर्म कहीं नहीं जाते।

अकेले: पेज चुनाव याद रखता है

पीछे कोई ऐप नहीं: फ़ॉर्म में कोई action नहीं है, और <html> तत्व पर data-rst-scheme-store="local" होने से fiesta.js चुनाव को ब्राउज़र में याद रखता है। गैलरी का अपना हेडर यही इस्तेमाल करता है।

पूर्वावलोकन
<footer rst-page-foot>
  <div rst-scheme="icons" role="group" aria-label="दिखावट">
    <form method="post">
      <input type="hidden" name="scheme" value="light">
      <input type="hidden" name="return" value="/">
      <button type="submit" aria-label="हल्का">
        <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/></svg>
      </button>
    </form>
    <form method="post">
      <input type="hidden" name="scheme" value="dark">
      <input type="hidden" name="return" value="/">
      <button type="submit" aria-label="गहरा" aria-current="true">
        <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/></svg>
      </button>
    </form>
    <form method="post">
      <input type="hidden" name="scheme" value="system">
      <input type="hidden" name="return" value="/">
      <button type="submit" aria-label="सिस्टम">
        <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/></svg>
      </button>
    </form>
  </div>
</footer>