1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 11:01:41 +01:00
metamask-extension/ui/app/css/itcss/components/newui-sections.scss
Nick Doiron d589d2dec0 Right-to-left CSS (using module for conversion) (#7072)
* Create RTL stylesheets using `gulp-rtl`

* Handle RTL stylesheet special cases

Certain blocks of Sass  were set to bypass "rtlcss" using ignore
comments. Certain icons had to be flipped 180 degrees.

* Switch stylesheets when locale changes

A second stylesheet has been added to each HTML page for use with
right-to-left locales. It is disabled by default. It is enabled on
startup if a RTL locale is set, and when switching to a RTL locale.
Similarly the LTR stylesheet is disabled when a RTL locale is used.

Unfortunately there is an unpleasant flash of unstyled content when
switching between a LTR and a RTL locale. There is also a slightly
longer page load time when using a RTL locale (<1s difference). We
couldn't think of an easy way to avoid these problems.

* Set `dir="auto"` as default on `TextFields`
2019-09-03 14:47:54 -03:00

242 lines
4.0 KiB
SCSS

$sub-mid-size-breakpoint: 667px;
$sub-mid-size-breakpoint-range: "screen and (min-width: #{$break-large}) and (max-width: #{$sub-mid-size-breakpoint})";
/*
NewUI Container Elements
*/
// Component Colors
$wallet-view-bg: $alabaster;
.app {
display: flex;
flex-direction: column;
height: 100%;
overflow-x: hidden;
position: relative;
align-items: center;
}
// Main container
.main-container {
// position: absolute;
z-index: $main-container-z-index;
font-family: Roboto;
display: flex;
flex-wrap: wrap;
align-items: stretch;
}
.main-container::-webkit-scrollbar {
display: none;
}
.main-container-wrapper {
display: flex;
justify-content: center;
flex: 1 0 auto;
min-height: 0;
width: 100%;
}
//Account and transaction details
.account-and-transaction-details {
display: flex;
flex: 1 1 auto;
min-width: 0;
}
// wallet view and sidebar
.wallet-view {
display: flex;
flex-direction: column;
flex: 32 1 32%;
width: 0;
background: $wallet-view-bg;
z-index: 200;
position: relative;
[dir='rtl'] & i.fa.fa-clipboard {
/*rtl:ignore*/
margin-left: 0 !important;
/*rtl:ignore*/
margin-right: 8px !important;
}
@media screen and (min-width: 576px) {
overflow-y: scroll;
overflow-x: hidden;
}
@media #{$sub-mid-size-breakpoint-range} {
min-width: 160px;
}
}
@media screen and (min-width: 576px) {
.wallet-view::-webkit-scrollbar {
display: none;
}
}
.wallet-view-title-wrapper {
flex: 0 0 25px;
}
.wallet-view-title {
margin-left: 15px;
font-size: 16px;
// No title on mobile
@media screen and (max-width: 575px) {
display: none;
}
}
.wallet-view.sidebar-right {
flex: 1 0 230px;
background: rgb(250, 250, 250);
z-index: $sidebar-z-index;
position: fixed;
top: 66px;
left: 0;
right: 0;
bottom: 0;
opacity: 1;
visibility: visible;
will-change: transform;
overflow-y: auto;
box-shadow: rgba(0, 0, 0, .15) 2px 2px 4px;
width: 85%;
height: calc(100% - 56px);
[dir='rtl'] & {
/* rtl:ignore */
left: 15%;
}
}
// main-container media queries
@media screen and (min-width: 576px) {
.lap-visible {
display: flex;
}
.phone-visible {
display: none;
}
.main-container {
// margin-top: 6.9vh;
width: 85vw;
height: 90vh;
box-shadow: 0 0 7px 0 rgba(0, 0, 0, .08);
}
}
@media screen and (min-width: 769px) {
.main-container {
// margin-top: 6.9vh;
width: 80vw;
height: 82vh;
box-shadow: 0 0 7px 0 rgba(0, 0, 0, .08);
}
}
@media screen and (min-width: 1281px) {
.main-container {
// margin-top: 6.9vh;
width: 62vw;
height: 82vh;
box-shadow: 0 0 7px 0 rgba(0, 0, 0, .08);
}
}
@media screen and (max-width: 575px) {
.lap-visible {
display: none;
}
.phone-visible {
display: flex;
}
.main-container {
width: 100%;
overflow-y: auto;
background-color: $white;
}
.main-container-wrapper {
flex: 1;
}
}
// account options dropdown
.account-options-menu {
align-items: center;
justify-content: flex-start;
margin: 5% 7% 0%;
}
.fiat-amount {
text-transform: uppercase;
}
.token-balance__amount {
padding: 0 6px;
}
// first time
.first-view-main {
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
@media screen and (max-width: 575px) {
height: 100%;
}
@media screen and (min-width: 576px) {
width: 85vw;
}
@media screen and (min-width: 769px) {
width: 80vw;
}
@media screen and (min-width: 1281px) {
width: 62vw;
}
}
.unlock-screen-container {
z-index: $main-container-z-index;
font-family: Roboto;
display: flex;
justify-content: center;
align-items: center;
flex: 1 0 auto;
background: #f7f7f7;
width: 100%;
}
.unlock-screen {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex: 1 0 auto;
}
.first-view-main-wrapper {
display: flex;
width: 100%;
height: 100%;
justify-content: center;
padding: 0 10px;
background: white;
}