Skip to content

Commit 5d11290

Browse files
committed
feat: style tweaks for legacy browsers
1 parent 5c194f1 commit 5d11290

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

packages/bytemd/src/toolbar-button.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
let el: HTMLElement;
1616
export let tooltip: BytemdToolbarItem['tooltip'];
1717
export let icon: BytemdToolbarItem['icon'];
18+
export let style: string | undefined;
1819
</script>
1920

2021
<svelte:options immutable={true} />
2122

22-
<span bind:this={el} on:click={() => dispatch('click')}>
23+
<span bind:this={el} on:click={() => dispatch('click')} {style}>
2324
{@html icon}
2425
</span>

packages/bytemd/src/toolbar.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@
5151
<ToolbarButton
5252
tooltip={itemMap[id].tooltip}
5353
icon={itemMap[id].icon}
54+
style={undefined}
5455
on:click={() => itemMap[id].onClick(context)} />
5556
{/if}
5657
{/each}
5758
{/if}
5859

59-
<div style="flex-grow:1" />
60-
6160
<ToolbarButton
6261
tooltip="About ByteMD"
6362
icon={icons.info}
63+
style="float:right"
6464
on:click={() => {
6565
window.open('https://github.com/bytedance/bytemd');
6666
}} />

packages/bytemd/styles/index.scss

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44

55
.bytemd {
66
border: 1px solid $gray-200;
7-
display: flex;
8-
flex-direction: column;
97
}
108

119
.bytemd-toolbar {
12-
display: flex;
13-
flex-wrap: wrap; // For mobile
1410
padding: 4px;
1511
border-bottom: 1px solid $gray-200;
12+
font-size: 0;
1613
> span {
14+
display: inline-block;
1715
cursor: pointer;
1816
border-radius: 2px;
1917
margin-left: 4px;
@@ -32,12 +30,13 @@
3230
}
3331

3432
.bytemd-tabs {
35-
display: flex;
33+
display: inline-block;
34+
vertical-align: top;
3635
span {
3736
cursor: pointer;
3837
padding-left: 8px;
3938
padding-right: 8px;
40-
line-height: 26px;
39+
line-height: 24px;
4140
font-size: 14px;
4241
&.bytemd-tab-active {
4342
color: $blue;
@@ -49,19 +48,12 @@
4948
font-size: 12px;
5049
}
5150

52-
.bytemd-info {
53-
position: absolute;
54-
}
55-
5651
.bytemd-body {
57-
flex-grow: 1;
58-
flex-basis: 0; // https://github.com/bytedance/bytemd/issues/8
59-
display: flex;
6052
overflow: auto;
53+
height: 300px;
6154
}
6255

6356
.bytemd-editor {
64-
flex: 1;
6557
overflow: hidden;
6658
height: 100%;
6759
.CodeMirror {
@@ -78,13 +70,20 @@
7870
}
7971

8072
.bytemd-preview {
81-
flex: 1;
73+
height: 100%;
8274
overflow: auto;
8375
.markdown-body {
8476
padding: 20px;
8577
}
8678
}
8779

88-
.bytemd-mode-split .bytemd-preview {
89-
border-left: 1px solid $gray-200;
80+
.bytemd-mode-split {
81+
.bytemd-editor {
82+
float: left;
83+
width: 50%;
84+
}
85+
.bytemd-preview {
86+
margin-left: 50%;
87+
border-left: 1px solid $gray-200;
88+
}
9089
}

0 commit comments

Comments
 (0)