1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

22 Commits

Author SHA1 Message Date
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
Mark Stacey
0f8a9a5d49
Serve CSS as an external file (#6894)
The CSS is now served as an external file instead of being injected.
This was done to improve performance. Ideally we would come to a middle
ground between this and the former behaviour by injecting only the CSS
that was required for the initial page load, then lazily loading the
rest. However that change would be more complex. The hope was that
making all CSS external would at least be a slight improvement.

Performance metrics were collected before and after this change to
determine whether this change actually helped. The metrics collected
were the timing events provided by Chrome DevTools:

* DOM Content Loaded (DCL) [1]
* Load (L) [2]
* First Paint (FP) [3]
* First Contentful Paint (FCP) [3]
* First Meaningful Paint (FMP) [3]

Here are the results (units in milliseconds):

Injected CSS:

| Run | DCL | L | FP | FCP | FMP |
| :--- | ---: | ---: | ---: | ---: | ---: |
| 1 | 1569.45 | 1570.97 | 1700.36 | 1700.36 | 1700.36 |
| 2 | 1517.37 | 1518.84 | 1630.98 | 1630.98 | 1630.98 |
| 3 | 1603.71 | 1605.31 | 1712.56 | 1712.56 | 1712.56 |
| 4 | 1522.15 | 1523.72 | 1629.3 | 1629.3 | 1629.3 |
| **Min** | 1517.37 | 1518.84 | 1629.3 | 1629.3 | 1629.3 |
| **Max** | 1603.71 | 1605.31 | 1712.56 | 1712.56 | 1712.56 |
| **Mean** | 1553.17 | 1554.71 | 1668.3 | 1668.3 | 1668.3 |
| **Std. dev.** | 33.41 | 33.43 | 38.16 | 38.16 | 38.16 |

External CSS:

| Run | DCL | L | FP | FCP | FMP |
| :--- | ---: | ---: | ---: | ---: | ---: |
| 1 | 1595.4 | 1598.91 | 284.97 | 1712.86 | 1712.86 |
| 2 | 1537.55 | 1538.99 | 199.38 | 1633.5 | 1633.5 |
| 3 | 1571.28 | 1572.74 | 268.65 | 1677.03 | 1677.03 |
| 4 | 1510.98 | 1512.33 | 206.72 | 1607.03 | 1607.03 |
| **Min** | 1510.98 | 1512.33 | 199.38 | 1607.03 | 1607.03 |
| **Max** | 1595.4 | 1598.91 | 284.97 | 1712.86 | 1712.86 |
| **Mean** | 1553.8025 | 1555.7425 | 239.93 | 1657.605 | 1657.605 |
| **Std. dev.** | 29.5375 | 30.0825 | 36.88 | 37.34 | 37.34 |

Unfortunately, using an external CSS file made no discernible improvement
to the overall page load time. DCM and L were practically identical, and
FCP and FMP were marginally better (well within error margins).

However, the first paint time was _dramatically_ improved. This change
seems worthwhile for the first paint time improvement alone. It also
allows us to delete some code and remove a dependency.

The old `css.js` module included two third-party CSS files as well, so
those have been imported into the main Sass file. This was easier than
bundling them in the gulpfile.

The resulting CSS bundle needs to be served from the root because we're
using a few `@include` rules that make this assumption. We could move
this under `/css/` if desired, but we'd need to update each of these
`@include` rules.

Relates to #6646

[1]: https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded
[2]: https://developer.mozilla.org/en-US/docs/Web/Events/load
[3]: https://developers.google.com/web/fundamentals/performance/user-centric-performance-metrics
2019-07-23 14:10:13 -03:00
Dan Miller
da5f4a792c Bundle some ui dependencies separately to limit the build size of ui.js 2018-10-31 20:47:22 -02:30
kumavis
253abd60fc build - extension - move js files to toplevel 2018-03-28 21:29:57 -07:00
kumavis
5815de33fb build - rename 'popup.js' to 'ui.js' 2018-03-28 14:04:33 -07:00
kumavis
5834c13769 ui - change window title 'MetaMask Plugin' to 'MetaMask' 2018-03-28 13:37:02 -07:00
Thomas Huang
ed33f3160a Make oldui compatible with newUI style changes 2018-02-15 12:36:26 -08:00
Chi Kei Chan
bffdde2082 Fix html height 2017-09-06 00:36:44 -07:00
sdtsui
9cc461a6c2 Reset popup to 350x500, old form factor as advised by @Zanibas 2017-07-31 23:07:25 -07:00
sdtsui
3797b9921f Adjust popup size to 545x450; refactor wallet view to fit 2017-07-31 20:22:15 -07:00
sdtsui
7ea38523ea Set font-size on body of popup.html, for responsiveness 2017-07-30 19:56:11 -07:00
sdtsui
dd3766242d Adjust dimensions of popup.html and app bar to match 2017-07-30 19:52:27 -07:00
Dan Finlay
651fec5112 Create distinct responsive 'home.html' file, hard-code popup.html size
Because firefox was having inconsistent sizing, made a second html file for forcing the view to a certain size. Still allows us to develop a responsive interface via the `home.html` file, which shares all the same react JS & CSS as popup.html.
2017-07-28 11:06:39 -07:00
Dan Finlay
9ac0a18f3b Correct viewport param 2017-07-27 18:43:18 -07:00
Dan Finlay
f795f30a67 Disable user zoom in mobile mode 2017-07-27 14:37:27 -07:00
Dan Finlay
65bd178b64 Fix viewport width to 1 2017-07-27 14:32:18 -07:00
Dan Finlay
8e2da52e64 Adjust mobile scale for smaller devices 2017-07-26 14:37:26 -07:00
Dan Finlay
8fc0a025f6 Set initial scale for mobile. 2017-07-26 14:36:22 -07:00
kumavis
3eaf027e30 migrate to new ui + provider 2016-01-14 18:26:54 -08:00
kumavis
709d93b5a1 start of extension popup window 2015-12-22 13:07:30 -08:00
kumavis
cc1bb92f9d build overhaul + basic structure 2015-08-01 16:33:31 -07:00
kumavis
500a95a704 init commit 2015-07-31 18:38:02 -07:00