Skip to content

Commit

Permalink
Merge pull request #553 from SolidOS/styleStreamline
Browse files Browse the repository at this point in the history
Style streamline
  • Loading branch information
bourgeoa authored Dec 4, 2023
2 parents f40cba9 + 9860a9c commit 26d24f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export function tabWidget (options: TabWidgetOptions) {
const rootElement: TabWidgetElement = dom.createElement('div') // 20200117a

rootElement.setAttribute('style', style.tabsRootElement)
rootElement.style.flexDirection = (vertical ? 'row' : 'column') + (flipped ? '-reverse;' : ';')
rootElement.style.flexDirection = (vertical ? 'row' : 'column') + (flipped ? '-reverse' : '')

const navElement = rootElement.appendChild(dom.createElement('nav'))
navElement.setAttribute('style', style.tabsNavElement)
Expand Down
8 changes: 4 additions & 4 deletions test/unit/tabs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,22 @@ describe('tabWidget', () => {
})
it('positions tabs on top by default', () => {
tabWidgetElement = tabs.tabWidget(minimalOptions)
expect(tabWidgetElement.style['flex-direction']).toEqual('column;')
expect(tabWidgetElement.style['flex-direction']).toEqual('column')
})

it('can position tabs on right', () => {
tabWidgetElement = tabs.tabWidget({ orientation: '1', ...minimalOptions })
expect(tabWidgetElement.style['flex-direction']).toEqual('row;')
expect(tabWidgetElement.style['flex-direction']).toEqual('row')
})

it('can position tabs on bottom', () => {
tabWidgetElement = tabs.tabWidget({ orientation: '2', ...minimalOptions })
expect(tabWidgetElement.style['flex-direction']).toEqual('column-reverse;')
expect(tabWidgetElement.style['flex-direction']).toEqual('column-reverse')
})

it('can position tabs on left', () => {
tabWidgetElement = tabs.tabWidget({ orientation: '3', ...minimalOptions })
expect(tabWidgetElement.style['flex-direction']).toEqual('row-reverse;')
expect(tabWidgetElement.style['flex-direction']).toEqual('row-reverse')
})
})

Expand Down

0 comments on commit 26d24f4

Please sign in to comment.