Skip to content

Commit

Permalink
fix(DIST-548): Make side tab button reponsive to text (#109)
Browse files Browse the repository at this point in the history
fix(DIST-548): Make side tab button reponsive to text
  • Loading branch information
Antonio authored Nov 30, 2020
1 parent 54ffb27 commit 8c47406
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 60 deletions.
49 changes: 31 additions & 18 deletions demo/popup-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
text-decoration: underline;
}

/* CSS for wrapper is required */
/* CSS for wrapper is required */
.side-panel-wrapper {
top: calc(50% - 300px); /* needs to be set manually based on popup size */
top: calc(50% - 300px);
/* needs to be set manually based on popup size */
right: 0;
position: fixed;
transition: width 300ms ease-out;
Expand All @@ -24,35 +25,47 @@

.side-panel {
position: absolute;
top: 300px; /* needs to be set manually based on button size */
width: 300px; /* needs to be set manually based on button size */
height: 40px;
top: 0;
left: 0;
margin: 0 auto;
/* needs to be set manually based on button size */
top: 300px;
max-height: 40px;
background: #427fed;
color: white;
padding: 0 20px;
white-space: nowrap;
padding: 8px 16px;
margin: 0;
text-decoration: none;
display: flex;
align-items: center;
justify-content: center;
justify-content: flex-start;
cursor: pointer;
transform: rotate(-90deg);
transform-origin: bottom left;
}

.side-panel > .icon {
.side-panel>.icon {
position: relative;
align-items: center;
justify-content: center;
display: flex;
width: 40px;
height: 40px;
margin-right: 10px;
display: block;
margin-right: 12px;
width: 24px;
height: 24px;
}

.side-panel>.icon>svg {
width: 100%;
height: 100%;
transform: rotate(90deg);
}

.side-panel img {
position: relative;
top: -4px;
}

.side-panel > .icon > svg {
transform-origin: left;
transform: translate(10px,-15px) rotate(90deg)
.side-panel>span {
flex-grow: 1;
}

.popover {
Expand Down Expand Up @@ -119,7 +132,7 @@
<div class="side-panel-wrapper">
<a id="btn-side_panel" class="side-panel">
<span class="icon">
<svg width="24" height="24" fill="none" style="margin-top:7px" viewBox="0 0 84 83">
<svg fill="none" viewBox="0 0 84 83">
<rect width="84" height="56" fill="#fff" rx="8" />
<path fill="#fff" d="M43 50h41v33L43 50z" opacity=".7" />
</svg>
Expand Down
97 changes: 55 additions & 42 deletions demo/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,60 @@
display: block;
}

/* CSS for wrapper is required */
.side-panel-wrapper {
top: calc(50% - 300px); /* needs to be set manually based on popup size */
right: 0;
position: fixed;
transition: width 300ms ease-out;
width: 0;
}

.side-panel {
position: absolute;
top: 300px; /* needs to be set manually based on button size */
width: 300px; /* needs to be set manually based on button size */
height: 40px;
background: #427fed;
color: white;
padding: 0 20px;
margin: 0;
text-decoration: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transform: rotate(-90deg);
transform-origin: bottom left;
}

.side-panel > .icon {
position: relative;
align-items: center;
justify-content: center;
display: flex;
width: 40px;
height: 40px;
margin-right: 10px;
}

.side-panel > .icon > svg {
transform-origin: left;
transform: translate(10px,-15px) rotate(90deg)
}
/* CSS for wrapper is required */
.side-panel-wrapper {
top: calc(50% - 300px);
/* needs to be set manually based on popup size */
right: 0;
position: fixed;
transition: width 300ms ease-out;
width: 0;
}

.side-panel {
position: absolute;
top: 0;
left: 0;
margin: 0 auto;
/* needs to be set manually based on button size */
top: 300px;
max-height: 40px;
background: #427fed;
color: white;
white-space: nowrap;
padding: 8px 16px;
margin: 0;
text-decoration: none;
display: flex;
align-items: center;
justify-content: flex-start;
cursor: pointer;
transform: rotate(-90deg);
transform-origin: bottom left;
}

.side-panel>.icon {
position: relative;
display: block;
margin-right: 12px;
width: 24px;
height: 24px;
}

.side-panel>.icon>svg {
width: 100%;
height: 100%;
transform: rotate(90deg);
}

.side-panel img {
position: relative;
top: -4px;
}

.side-panel>span {
flex-grow: 1;
}

.popover {
width: 54px;
Expand Down Expand Up @@ -189,7 +202,7 @@
target="_blank"
>
<span class="icon">
<svg width="24" height="24" fill="none" style="margin-top:7px" viewBox="0 0 84 83">
<svg fill="none" viewBox="0 0 84 83">
<rect width="84" height="56" fill="#fff" rx="8" />
<path fill="#fff" d="M43 50h41v33L43 50z" opacity=".7" />
</svg>
Expand Down

0 comments on commit 8c47406

Please sign in to comment.