docs: added fiddle support for code samples (#26501)
* docs: added fiddle support for code samples in quick start guide and features * docs: removed excessive fiddle links for not final steps * docs: added eof newlines to fiddle examples * docs: reworked fiddle examples to be more self-sufficient * docs: reworked fiddle examples according to mentions * docs: changed http to https in the offscreen rendering fiddle * docs: fix recent documents fiddle to be more consistent
This commit is contained in:
parent
770e245de5
commit
fadd513739
48 changed files with 787 additions and 29 deletions
|
@ -96,7 +96,7 @@ color scheme, and update the "Current Theme Source" label to `System`.
|
|||
|
||||
To add listeners and handlers, add the following lines to the `renderer.js` file:
|
||||
|
||||
```js
|
||||
```javascript
|
||||
const { ipcRenderer } = require('electron')
|
||||
|
||||
document.getElementById('toggle-dark-mode').addEventListener('click', async () => {
|
||||
|
@ -130,7 +130,7 @@ active using the `nativeTheme.shouldUseDarkColors` property, and set the
|
|||
`themeSource` to the opposite theme.
|
||||
* Upon receiving `dark-mode:system`, we reset the `themeSource` to `system`.
|
||||
|
||||
```js
|
||||
```javascript
|
||||
const { app, BrowserWindow, ipcMain, nativeTheme } = require('electron')
|
||||
|
||||
function createWindow () {
|
||||
|
@ -180,7 +180,7 @@ attribute. The value of `prefers-color-scheme` will follow your
|
|||
|
||||
Create a `styles.css` file and add the following lines:
|
||||
|
||||
```css
|
||||
```css fiddle='docs/fiddles/features/macos-dark-mode'
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body { background: #333; color: white; }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue