-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ui): improve UX and redefine all classes and styles to make …
…the iframe more isolated
- Loading branch information
Showing
65 changed files
with
669 additions
and
1,082 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Styles for the example components and stories: | ||
*/ | ||
.story-1 { | ||
color: green; | ||
font-size: 28px; | ||
} |
57 changes: 57 additions & 0 deletions
57
packages/examples/react/src/styles/storylite-overrides.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Custom StoryLite iframe styles | ||
*/ | ||
|
||
.storylite-iframe { | ||
font-family: 'Courier New', Courier, monospace; | ||
background: transparent; | ||
} | ||
[data-sl-darkmode='true']:where(.storylite-iframe--standalone) { | ||
color: var(--storylite-font-color); | ||
background-color: var(--storylite-bg-color); | ||
} | ||
|
||
/* | ||
* DARK-THEME | ||
*/ | ||
[data-sl-darkmode='true']:where(.storylite-iframe) { | ||
/* General */ | ||
--storylite-font-color: #dfdfd7; | ||
--storylite-bg-color: #252529; | ||
|
||
--storylite-border-color: #29292c; | ||
|
||
/* Muted */ | ||
--storylite-font-color-muted: #999999; | ||
--storylite-border-color-muted: #484848; | ||
|
||
/* Panels */ | ||
--storylite-font-color-panel: #dfdfd7; | ||
--storylite-bg-color-panel: #161618; | ||
|
||
/* Toolbars */ | ||
--storylite-font-color-toolbar: #999999; | ||
--storylite-bg-color-toolbar: #1e1e20; | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
[data-sl-darkmode='auto']:where(.storylite-iframe) { | ||
/* General */ | ||
--storylite-font-color: #dfdfd7; | ||
--storylite-bg-color: #252529; | ||
|
||
--storylite-border-color: #29292c; | ||
|
||
/* Muted */ | ||
--storylite-font-color-muted: #999999; | ||
--storylite-border-color-muted: #484848; | ||
|
||
/* Panels */ | ||
--storylite-font-color-panel: #dfdfd7; | ||
--storylite-bg-color-panel: #161618; | ||
|
||
/* Toolbars */ | ||
--storylite-font-color-toolbar: #999999; | ||
--storylite-bg-color-toolbar: #1e1e20; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import '@storylite/storylite/styles.css' | ||
import './src/styles/components.css' | ||
import './src/styles/storylite-overrides.css' | ||
|
||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
|
||
import { StoryLiteApp } from '@storylite/storylite' | ||
import { renderStoryLiteApp } from '@storylite/storylite' | ||
import stories from '@storylite/vite-plugin:stories' | ||
|
||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( | ||
<React.StrictMode> | ||
<StoryLiteApp | ||
stories={stories} | ||
config={{ | ||
title: ' ⚡️ StoryLite React', | ||
defaultStory: 'index', | ||
}} | ||
/> | ||
</React.StrictMode>, | ||
) | ||
const rootElement = document.getElementById('root') as HTMLElement | ||
|
||
renderStoryLiteApp(rootElement, stories, { | ||
title: ' ⚡️ StoryLite React', | ||
defaultStory: 'index', | ||
iframeProps: { | ||
style: { | ||
padding: '10px', | ||
}, | ||
}, | ||
iframeOptions: { | ||
useDefaultStyles: false, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
packages/storylite/src/components/addons/DarkModeAddon.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.