diff --git a/source/_static/css/custom.css b/source/_static/css/custom.css index 7d05184c01..7143ea1085 100644 --- a/source/_static/css/custom.css +++ b/source/_static/css/custom.css @@ -131,7 +131,8 @@ html { /* Tutorial page styling */ .tutorial-section { - background-color: #edf2f7; /* Slightly darker background */ + background-color: var(--pst-color-on-background); + border-color: var(--pst-color-border); padding: 25px 25px 25px 40px !important; /* top right bottom left - more padding on left */ margin: 20px 0; border-radius: 8px; @@ -160,6 +161,28 @@ html { background-color: #fefce8 !important; /* Light yellow */ border: 1px solid #fef9c3 !important; } + +/* Dark mode variants */ +html[data-theme="dark"] .tutorial-section-blue { + background-color: #1e2937 !important; /* Dark blue */ + border: 1px solid #2d3748 !important; +} + +html[data-theme="dark"] .tutorial-section-green { + background-color: #1a2e1a !important; /* Dark green */ + border: 1px solid #2d482d !important; +} + +html[data-theme="dark"] .tutorial-section-purple { + background-color: #2d1a2e !important; /* Dark purple */ + border: 1px solid #482d48 !important; +} + +html[data-theme="dark"] .tutorial-section-yellow { + background-color: #2e2d1a !important; /* Dark yellow */ + border: 1px solid #48482d !important; +} + /* Main layout fixes - these were working well */ .bd-container__inner.bd-page-width { max-width: none; @@ -203,16 +226,34 @@ html { left: 0; padding-left: 1rem; z-index: 1; /* Reduced z-index */ - background: white; + background: var(--pst-color-on-background); max-width: 167px; /* Match logo's natural width*/ } +/* Dark mode switching */ +html[data-theme="dark"] .light-logo { + display: none; +} + +html[data-theme="dark"] .dark-logo { + display: block; +} + /* Menu positioning */ .navbar-header-items:not(.navbar-header-items__start) { margin-left: 200px; position: relative; z-index: 2; /* Higher than logo */ - background: white; + background: var(--pst-color-on-background); +} + +/* Logo handling for dark/light mode */ +.light-logo { + display: block; +} + +.dark-logo { + display: none; } img.logo { @@ -225,10 +266,17 @@ img.logo { .navbar-header-items__start{ max-width: 120px; /* Smaller width on mobile */ margin-left: 3rem; /* Make space for menu button */ + background: var(--pst-color-on-background); /* Single background property */ } img.logo{ width: 100%; height: auto; } +} + +/* Dark mode specific adjustments if needed */ +html[data-theme="dark"] .navbar-header-items__start, +html[data-theme="dark"] .navbar-header-items:not(.navbar-header-items__start) { + background: var(--pst-color-on-background); /* Ensures correct dark mode background */ } \ No newline at end of file diff --git a/source/_static/css/style.css b/source/_static/css/style.css index 9ca396754d..81f9805a62 100644 --- a/source/_static/css/style.css +++ b/source/_static/css/style.css @@ -11,7 +11,10 @@ --pst-font-family-base: var(--pst-font-family-base-system); --pst-font-family-heading: var(--pst-font-family-base); --pst-font-family-monospace: var(--pst-font-family-monospace-system); +} +/* Light theme (default) - keeping previous values*/ +html[data-theme="light"] { /***************************************************************************** * Colors **/ @@ -31,20 +34,21 @@ --heading-color: #333333; } -html { - --pst-color-primary: #48A2AE; - --pst-color-primary-text: #333333; - --pst-color-secondary: #052535; - --pst-color-link: #48A2AE; - --pst-color-link-hover: #48A2AE; - --pst-color-inline-code: 178, 34, 34; - --pst-color-sidebar-link-hover: #48A2AE; - --pst-color-toc-link-hover: #48A2AE; - --pst-color-toc-link-active: #48A2AE; - --pst-color-headerlink: #48A2AE; - --pst-color-headerlink-hover: #48A2AE; - --bg-color: #ffffff; - --heading-color: #333333; +/* Dark theme */ +html[data-theme="dark"] { + --pst-color-primary: #5CBFCC; + --pst-color-primary-text: #ffffff; + --pst-color-secondary: #7FB9C2; + --pst-color-link: #5CBFCC; + --pst-color-link-hover: #7FB9C2; + --pst-color-inline-code: rgb(255, 99, 99); + --pst-color-sidebar-link-hover: #5CBFCC; + --pst-color-toc-link-hover: #5CBFCC; + --pst-color-toc-link-active: #5CBFCC; + --pst-color-headerlink: #5CBFCC; + --pst-color-headerlink-hover: #5CBFCC; + --bg-color: #1a1a1a; + --heading-color: #ffffff; } html { @@ -56,49 +60,48 @@ html { body{ font-family: var(--pst-font-family-base-system); background-color: var(--bg-color); - color: #333333; - ; + color: var(--pst-color-primary-text); } /* Text styling */ p{ line-height: 1.7em; font-size: 16px; - color: #333333; + color: var(--pst-color-primary-text); font-family: var(--pst-font-family-base-system); } h1{ font-family: var(--pst-font-family-base-system); - color: #333333; + color: var(--pst-color-on-background); margin-bottom: 34px; } h2{ font-family: var(--pst-font-family-base-system); - color: #333333; + color: var(--pst-color-on-background); margin-bottom: 28px; } h3{ font-family: var(--pst-font-family-base-system); - color: #333333; + color: var(--pst-color-on-background); margin-bottom: 24px; } h4{ font-family: var(--pst-font-family-base-system); - color: #333333; + color: var(--pst-color-on-background); } h5{ font-family: var(--pst-font-family-base-system); - color: #333333; + color: var(--pst-color-on-background); } h6{ font-family: var(--pst-font-family-base-system); - color: #333333; + color: var(--pst-color-on-background); } a{ @@ -148,6 +151,10 @@ p.prev-next-title:hover{ --pst-color-accent: #48A2AE; } +html[data-theme="dark"] .bd-search input { + --pst-color-accent: #5CBFCC; +} + .toc-entry a.nav-link.active { box-shadow: none; } @@ -163,6 +170,20 @@ p.prev-next-title:hover{ padding-right: 0.5em; } +/* Dark mode styles for code */ +html[data-theme="dark"] .highlight .hll { + background-color: #1e3d1e; +} + +html[data-theme="dark"] pre { + background-color: var(--pst-color-on-background); + color: var(--pst-color-primary-text); +} + +html[data-theme="dark"] .highlight { + background-color: var(--pst-color-on-background); +} + /*Video handling*/ iframe { @@ -178,16 +199,26 @@ iframe { padding: 0; display: flex; align-items: center; + background-color: var(--pst-color-on-background); + background: var(--pst-color-background); } .nav-item{ --pst-color-link-hover: #48A2AE; } +html[data-theme="dark"] .nav-item { + --pst-color-link-hover: #5CBFCC; +} + .search-button__button{ --pst-color-link-hover: #48A2AE; } +html[data-theme="dark"] .search-button__button { + --pst-color-link-hover: #5CBFCC; +} + .navbar-end{ width: 33%; } @@ -206,7 +237,7 @@ iframe { } .fa-chevron-down:before { - color: #888888; + color: var(--pst-color-text-muted, #888888); /* Add variable with fallback */ } .bd-sidebar label { @@ -270,7 +301,7 @@ ul.list-caption li.selected > label i:before { .bd-sidebar .nav li>a { padding: 4px 0 0 22px; - color: #888888; + color: var(--pst-color-text-muted, #888888); /* Add variable with fallback */ } .bd-sidebar .nav li.has-children>a { @@ -286,7 +317,7 @@ nav.bd-links p.caption { text-transform: unset; font-weight: unset; font-size: 14px; - color: #888888; + color: var(--pst-color-text-muted, #888888); /* Add variable with fallback */ } nav.bd-links .current>a { @@ -300,9 +331,15 @@ nav.bd-links .current>a { .bd-search input { border-radius: 16px; - border: 1px solid #e7e7e7; + border: 1px solid var(--pst-color-border, #e7e7e7); padding: 24px 24px 24px 50px; font-size: 15px; + background-color: var(--pst-color-background); + color: var(--pst-color-text); +} + +html[data-theme="dark"] .bd-search input { + border-color: var(--pst-color-border, #404040); } .rst-versions.shift-up { @@ -346,7 +383,7 @@ div.admonition { } .admonition.warning { - background: #ffffff; + background: var(--pst-color-on-background); border-color: #F6DB9A; border: 1px solid; } @@ -356,7 +393,7 @@ div.admonition { } .admonition.note { - background: #ffffff; + background: var(--pst-color-on-background); border-color: #acceed; border: 1px solid; } @@ -469,7 +506,7 @@ div.admonition { .row .bd-sidebar .sidebar-start-items { width: 100vw; height: 100vh; - background-color: #ededed; + background-color: var(--pst-color-background); margin-left: -15px; padding: 0 15px; } @@ -485,11 +522,12 @@ div.admonition { .bd-search .icon { left: 22px; + color: var(--pst-color-text-muted); } .bd-links { - background-color: #ededed; padding-left: 15px; + background-color: var(--pst-color-background); } .bd-search { @@ -506,7 +544,6 @@ div.admonition { position: absolute; top: calc(100vh - 65px); width: 100%; - background-color: #dbdbdb; } .bd-toc-item.active { diff --git a/source/_static/css/tippy.css b/source/_static/css/tippy.css index 4bb87638e5..d625f7e8ed 100644 --- a/source/_static/css/tippy.css +++ b/source/_static/css/tippy.css @@ -1,4 +1,4 @@ .tippy-box { - background-color: #e5e5e5; - color:var(--pst-font-color); + background-color: var(--pst-color-on-background); + color: var(--pst-color-on-surface); } diff --git a/source/_templates/navbar-logo.html b/source/_templates/navbar-logo.html index 753eb7c238..70e107b268 100644 --- a/source/_templates/navbar-logo.html +++ b/source/_templates/navbar-logo.html @@ -7,6 +7,7 @@
- + +
diff --git a/source/mainnet/conf.py b/source/mainnet/conf.py index 87af47b433..b37890092a 100644 --- a/source/mainnet/conf.py +++ b/source/mainnet/conf.py @@ -156,7 +156,7 @@ "navigation_depth": 5, "navbar_start": ["navbar-logo"], "navbar_center": ["navbar-nav"], - "navbar_end": ["navbar-icon-links"], + "navbar_end": ["navbar-icon-links", "theme-switcher"], "secondary_sidebar_items": ["page-toc", "edit-this-page"], "article_footer_items": ["footer-article"], "show_prev_next": True, @@ -256,7 +256,7 @@ "github_version": "main", "doc_path": "source/mainnet", "conf_py_path": "/source/", - "default_mode": "light", + "default_mode": "auto", } # Add any paths that contain custom static files (such as style sheets) here, diff --git a/source/mainnet/docs/smart-contracts/contract-instances.rst b/source/mainnet/docs/smart-contracts/contract-instances.rst index 6215a8e45b..b301d2dc1e 100644 --- a/source/mainnet/docs/smart-contracts/contract-instances.rst +++ b/source/mainnet/docs/smart-contracts/contract-instances.rst @@ -91,7 +91,7 @@ transaction for attempting to create the instance is visible on-chain. .. seealso:: - See :ref:`initialize-contract` guide for how to initialize a + See the :ref:`initialize-contract` guide for how to initialize a contract in practice. You can also watch a video about initializing smart contract instances. .. raw:: html diff --git a/source/mainnet/docs/smart-contracts/contract-lifecycle.rst b/source/mainnet/docs/smart-contracts/contract-lifecycle.rst index 7baf112f0d..a010cbe28d 100644 --- a/source/mainnet/docs/smart-contracts/contract-lifecycle.rst +++ b/source/mainnet/docs/smart-contracts/contract-lifecycle.rst @@ -8,6 +8,8 @@ A smart contract is first deployed to the chain as part of a :ref:`contract module `. After this a smart contract can be *initialized* to obtain a :ref:`smart contract instance `. Finally a smart contract instance can be repeatedly updated according to its own logic. +Before you can follow this guide, you need to :ref:`setup the development environment `. + .. image:: images/smart-contract-lifecycle.png :width: 100% diff --git a/source/mainnet/docs/smart-contracts/contract-module.rst b/source/mainnet/docs/smart-contracts/contract-module.rst index c878e138a4..b68e434ce1 100644 --- a/source/mainnet/docs/smart-contracts/contract-module.rst +++ b/source/mainnet/docs/smart-contracts/contract-module.rst @@ -44,6 +44,7 @@ the code. Wasm is a low-level language and it is impractical to write by hand. Instead, you can write smart contracts in a more high-level language that is then compiled to Wasm. The best supported high-level language on Concordium is Rust. +You can read :ref:`this article ` for more information regarding using Rust on Concordium. .. _wasm-limitations: @@ -75,7 +76,7 @@ point values. Deployment ========== -Deploying a module to the chain means submitting the module bytecode as a +:ref:`Deploying ` a module to the chain means submitting the module bytecode as a transaction to the Concordium network. If *valid*, this transaction will be included in a block. This transaction, as every other transaction, has an associated cost. The cost is based on the size of the bytecode and is charged diff --git a/source/mainnet/docs/smart-contracts/develop-contracts.rst b/source/mainnet/docs/smart-contracts/develop-contracts.rst index 2f34026019..7ea0d2f514 100644 --- a/source/mainnet/docs/smart-contracts/develop-contracts.rst +++ b/source/mainnet/docs/smart-contracts/develop-contracts.rst @@ -420,5 +420,5 @@ macro, e.g.: ``#[init(..., payable)]`` and ``#[receive(..., payable)]``. .. |StateMap| replace:: ``StateMap`` .. _StateSet: https://docs.rs/concordium-std/latest/concordium_std/struct.StateSet.html .. |StateSet| replace:: ``StateSet`` -.. _payable: https://docs.rs/concordium-std-derive/latest/concordium_std_derive/attr.init.html#payable-make-function-accept-an-amount-of-ccd +.. _payable: https://docs.rs/concordium-std/latest/concordium_std/attr.receive.html#payable-make-function-accept-an-amount-of-ccd .. |payable| replace:: ``payable`` diff --git a/source/mainnet/docs/smart-contracts/guides/build-contract.rst b/source/mainnet/docs/smart-contracts/guides/build-contract.rst index e1085efe06..bdf33f421b 100644 --- a/source/mainnet/docs/smart-contracts/guides/build-contract.rst +++ b/source/mainnet/docs/smart-contracts/guides/build-contract.rst @@ -14,8 +14,7 @@ Once you are familiar with smart contracts, it is a good idea to read the :ref:` To request CCDs for testing, use the buttons in the Concordium Wallets when running Testnet. -Before you can start developing smart contracts, you need to setup the -environment. +Before you can start developing smart contracts, you need to :ref:`setup the development environment `. You can also watch a video about installing the smart contract tools. diff --git a/source/mainnet/docs/smart-contracts/guides/quick-start.rst b/source/mainnet/docs/smart-contracts/guides/quick-start.rst index af10bf2d6b..682302e31d 100644 --- a/source/mainnet/docs/smart-contracts/guides/quick-start.rst +++ b/source/mainnet/docs/smart-contracts/guides/quick-start.rst @@ -64,14 +64,12 @@ Before starting, it is a good idea to read the :ref:`Smart contracts best practi .. dropdown:: Step 3 - Set up a Concordium Wallet - You need to set up a Concordium wallet and export the keys to import them to `concordium client`. You can only import keys from |bw|, |mw-gen2|, or |mw-gen1| into `concordium-client`, so you must choose one of those wallets to set up. + You need to set up a Concordium wallet and export the keys to import them to `concordium client`. You can only import keys from |bw| or |cryptox| into `concordium-client`, so you must choose to set up one of those wallets. - |bw| :ref:`setup` - :ref:`Key export` - - |mw-gen2| :ref:`setup` + - |cryptox| :ref:`setup` - :ref:`Key export` - - |mw-gen1| :ref:`setup` - - :ref:`Key export` - :ref:`Import keys to concordium-client` Use the testnet faucet in your wallet to get some CCDs for testing. The testnet faucet is available once you create an account. diff --git a/source/mainnet/docs/smart-contracts/introduction.rst b/source/mainnet/docs/smart-contracts/introduction.rst index 35fa0bb077..900c379735 100644 --- a/source/mainnet/docs/smart-contracts/introduction.rst +++ b/source/mainnet/docs/smart-contracts/introduction.rst @@ -11,7 +11,7 @@ What is a smart contract =============================== -Already know what smart contracts are? Go to the :ref:`quick guide` to start building smart contracts on Concordium right away. +Already know what smart contracts are? Go to the :ref:`quick start guide` to start building smart contracts on Concordium right away. A :term:`smart contract` is a user-supplied piece of code submitted to the Concordium blockchain, used to define behavior that is not directly part of the core @@ -81,7 +81,8 @@ does not fulfil their obligations. This will most likely mean that the contract needs to support some notion of proof that the seller has indeed fulfilled their obligation, or some way for the highest bidder to file a complaint. Smart contracts cannot resolve these real-world issues automatically, and the best -solution is likely going to depend on the specifics of the auction. +solution is likely going to depend on the specifics of the auction. You can find +an example implementation of the auction contract on `this repository `_ Additional reading ------------------ diff --git a/source/mainnet/docs/voting/gc-voting.rst b/source/mainnet/docs/voting/gc-voting.rst index e9eabfc471..2856fb0082 100644 --- a/source/mainnet/docs/voting/gc-voting.rst +++ b/source/mainnet/docs/voting/gc-voting.rst @@ -71,4 +71,4 @@ After the election is the :term:`tally phase`. Components for voting ===================== -There are a number of components used during voting, including the coordinator tool, the voting dApp, and the Guardian application. You can explore the `repository for the components `. +There are a number of components used during voting, including the coordinator tool, the voting dApp, and the Guardian application. You can explore the `repository for the components `_.