Skip to content

Commit

Permalink
Show usage of all:initial
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Mar 3, 2021
1 parent d40d3ab commit 1780e37
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 112 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React from 'react'
import createSessionModel from '../createModel/createSessionModel'
import ModalWidget from './ModalWidget'
import ViewContainer from './ViewContainer'
import './App.css'

type Session = Instance<ReturnType<typeof createSessionModel>>
function JBrowseLinearGenomeView({
Expand All @@ -21,7 +20,9 @@ function JBrowseLinearGenomeView({
const { ReactComponent } = viewType

return (
<div className="yui3-cssreset">
// avoid parent styles getting into this div
// https://css-tricks.com/almanac/properties/a/all/
<div style={{ all: 'initial' }}>
<ViewContainer key={`view-${view.id}`} view={view}>
<ReactComponent model={view} session={session} />
</ViewContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ export const OneLinearGenomeView = () => {
)
}

export const OneLinearGenomeViewWithOutsideStyling = () => {
const state = createViewState({
assembly,
tracks,
defaultSession,
location: 'ctgA:1105..1221',
onChange: patch => {
// eslint-disable-next-line no-console
console.log('patch', patch)
},
})
return (
<div style={{ textAlign: 'center', fontFamily: 'monospace' }}>
<h2>Hello world, this is centered but not affecting the internal LGV</h2>
<ThemeProvider theme={theme}>
<JBrowseLinearGenomeView viewState={state} />
</ThemeProvider>
</div>
)
}

export const TwoLinearGenomeViews = () => {
const state1 = createViewState({
assembly,
Expand Down

0 comments on commit 1780e37

Please sign in to comment.