Commit 4b03bee7 authored by fukino@chromium.org's avatar fukino@chromium.org

Use CSS3 flex to lay out Files.app components.

This CL includes:
- Simple replacement by following rules.
    s/display: -webkit-box/display: flex/
    s/-webkit-box-orient: vertical/flex-direction: column/
    s/-webkit-box-orient: horizontal/flex-direction: row/
    s/-webkit-box-flex: 1/flex: auto/
    s/-webkit-box-flex: 0/flex: none/
    s/-webkit-box-pack: start/justify-content: flex-start/
    s/-webkit-box-pack: end/justify-content: flex-end/
    s/-webkit-box-pack: center/justify-content: center/
    s/-webkit-box-align: center/align-items: center/
    s/-webkit-box-align: baseline/align-items: baseline/
    s/-webkit-box-align: stretch/align-items: stretch/
- Flex items in "-webkit-box" don't shrink by default, but ones in "flex" shrink by default. So some flex items are specified "flex: none;" additionally. 
- "vertical-align: middle;" doesn't work for flex items, so specify "align-items: center;" for their parents.
- Some position adjustment taking care of difference between "-webkit-box" and "flex". (commented inline)

BUG=387568

Review URL: https://codereview.chromium.org/376783002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281985 0039d316-1c4b-4281-b951-d872f2087c98
parent adeb16a4
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* found in the LICENSE file. */ * found in the LICENSE file. */
.buttonbar button.combobutton { .buttonbar button.combobutton {
-webkit-box-align: stretch; align-items: stretch;
display: -webkit-box; display: flex;
} }
.buttonbar .combobutton > .action { .buttonbar .combobutton > .action {
......
...@@ -61,7 +61,7 @@ input.common[type='checkbox'].white:checked::after { ...@@ -61,7 +61,7 @@ input.common[type='checkbox'].white:checked::after {
input.common[type='checkbox']::after { input.common[type='checkbox']::after {
content: ''; content: '';
display: -webkit-box; display: flex;
height: 15px; height: 15px;
left: -2px; left: -2px;
position: absolute; position: absolute;
...@@ -116,7 +116,7 @@ input.common[type='checkbox']::after { ...@@ -116,7 +116,7 @@ input.common[type='checkbox']::after {
} }
.buttonbar { .buttonbar {
display: -webkit-box; display: flex;
height: 31px; height: 31px;
} }
...@@ -365,11 +365,11 @@ html[dir='rtl'] .entry-name { ...@@ -365,11 +365,11 @@ html[dir='rtl'] .entry-name {
/* Pop-up dialogs. */ /* Pop-up dialogs. */
.cr-dialog-container { .cr-dialog-container {
-webkit-box-align: center;
-webkit-box-pack: center;
-webkit-user-select: none; -webkit-user-select: none;
display: -webkit-box; align-items: center;
display: flex;
height: 100%; height: 100%;
justify-content: center;
left: 0; left: 0;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
...@@ -380,14 +380,14 @@ html[dir='rtl'] .entry-name { ...@@ -380,14 +380,14 @@ html[dir='rtl'] .entry-name {
} }
.cr-dialog-frame { .cr-dialog-frame {
-webkit-box-orient: vertical;
background-color: rgb(250, 250, 250); background-color: rgb(250, 250, 250);
border: 1px solid rgb(255, 255, 255); border: 1px solid rgb(255, 255, 255);
border-radius: 2px; border-radius: 2px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .5); box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .5);
color: rgb(34, 34, 34); color: rgb(34, 34, 34);
cursor: default; cursor: default;
display: -webkit-box; display: flex;
flex-direction: column;
padding: 20px; padding: 20px;
position: relative; position: relative;
width: 460px; width: 460px;
...@@ -476,9 +476,9 @@ html[dir='rtl'] .entry-name { ...@@ -476,9 +476,9 @@ html[dir='rtl'] .entry-name {
} }
.cr-dialog-buttons { .cr-dialog-buttons {
-webkit-box-orient: horizontal; display: flex;
-webkit-box-pack: end; flex-direction: row;
display: -webkit-box; justify-content: flex-end;
padding-top: 10px; padding-top: 10px;
} }
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
} }
.drive-welcome-links { .drive-welcome-links {
-webkit-box-orient: horizontal; display: flex;
display: -webkit-box; flex-direction: row;
} }
.drive-welcome-button { .drive-welcome-button {
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
/* Header welcome banner. */ /* Header welcome banner. */
.drive-welcome.header { .drive-welcome.header {
-webkit-box-flex: 0; flex: none;
height: 100px; height: 100px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
...@@ -83,10 +83,10 @@ ...@@ -83,10 +83,10 @@
} }
.drive-welcome.header .drive-welcome-wrapper { .drive-welcome.header .drive-welcome-wrapper {
-webkit-box-orient: horizontal;
background-size: 308px 100px; background-size: 308px 100px;
bottom: 0; bottom: 0;
display: -webkit-box; display: flex;
flex-direction: row;
left: 0; left: 0;
position: absolute; position: absolute;
right: 0; right: 0;
...@@ -100,9 +100,9 @@ ...@@ -100,9 +100,9 @@
} }
.drive-welcome.header .drive-welcome-message { .drive-welcome.header .drive-welcome-message {
-webkit-box-flex: 1; display: flex;
-webkit-box-orient: vertical; flex: auto;
display: -webkit-box; flex-direction: column;
} }
.drive-welcome.header .drive-welcome-title { .drive-welcome.header .drive-welcome-title {
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
/* Full page welcome banner. */ /* Full page welcome banner. */
.drive-welcome.page { .drive-welcome.page {
bottom: 0; bottom: 0;
flex: none;
left: 0; left: 0;
position: absolute; position: absolute;
right: 0; right: 0;
...@@ -137,11 +138,11 @@ ...@@ -137,11 +138,11 @@
} }
.drive-welcome.page .drive-welcome-wrapper { .drive-welcome.page .drive-welcome-wrapper {
-webkit-box-align: center; align-items: center;
-webkit-box-orient: vertical;
background-size: 520px 173px; background-size: 520px 173px;
bottom: 0; bottom: 0;
display: -webkit-box; display: flex;
flex-direction: column;
font-size: 120%; font-size: 120%;
left: 0; left: 0;
overflow: hidden; overflow: hidden;
......
...@@ -13,13 +13,13 @@ html.col-resize * { ...@@ -13,13 +13,13 @@ html.col-resize * {
} }
.table-row { .table-row {
display: -webkit-box; display: flex;
text-align: start; text-align: start;
width: 100%; width: 100%;
} }
.table-row-cell { .table-row-cell {
display: -webkit-box; display: flex;
overflow: hidden; overflow: hidden;
} }
...@@ -37,7 +37,7 @@ html.col-resize * { ...@@ -37,7 +37,7 @@ html.col-resize * {
.table-header-inner { .table-header-inner {
-webkit-user-select: none; -webkit-user-select: none;
cursor: default; cursor: default;
display: -webkit-box; display: flex;
position: relative; position: relative;
text-align: start; text-align: start;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment