material 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -1
- package/package.json +3 -3
- package/src/button.js +7 -33
- package/src/card.js +0 -5
- package/src/element/insert.js +3 -1
- package/src/file.js +0 -10
- package/src/item.js +28 -78
- package/src/loader.js +88 -0
- package/src/mixin/control.js +0 -35
- package/src/mixin/display.js +1 -16
- package/src/mixin/label.js +0 -4
- package/src/module/attach.js +3 -9
- package/src/module/attributes.js +7 -14
- package/src/module/build.js +25 -0
- package/src/module/cookie.js +24 -0
- package/src/module/last.js +6 -16
- package/src/module/numabbr.js +28 -0
- package/src/module/object.js +2 -2
- package/src/module/observer.js +2 -2
- package/src/module/passive.js +1 -1
- package/src/module/remove.js +3 -38
- package/src/module/request.js +0 -1
- package/src/module/ripple.js +2 -1
- package/src/module/touch.js +1 -1
- package/src/module/utils.js +0 -31
- package/src/module/viewport.js +4 -10
- package/src/navigation.js +55 -5
- package/src/skin/material/control/snackbar.sass +1 -1
- package/src/styles/M3/app/index.sass +19 -0
- package/src/styles/M3/base/body.sass +55 -0
- package/src/styles/M3/base/elevation.sass +50 -0
- package/src/styles/M3/base/grid.sass +63 -0
- package/src/styles/M3/base/typo.sass +107 -0
- package/src/styles/M3/components/button.sass +15 -2
- package/src/styles/M3/navigation/rail.sass +72 -0
- package/src/styles/M3/view/view.sass +2 -0
- package/src/switch.js +2 -37
- package/src/text.js +8 -0
- package/src/view.js +1 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const numabbr = (number, decimals = 2) => {
|
|
2
|
+
if (typeof number !== 'number' || isNaN(number)) {
|
|
3
|
+
return null
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const factor = Math.pow(10, decimals)
|
|
7
|
+
const abbrev = ['k', 'm', 'b', 't']
|
|
8
|
+
|
|
9
|
+
for (let i = abbrev.length - 1; i >= 0; i--) {
|
|
10
|
+
const size = Math.pow(10, (i + 1) * 3)
|
|
11
|
+
|
|
12
|
+
if (size <= number) {
|
|
13
|
+
let num = Math.round(number * factor / size) / factor
|
|
14
|
+
|
|
15
|
+
// Handle special case where we round up to the next abbreviation
|
|
16
|
+
if (num === 1000 && i < abbrev.length - 1) {
|
|
17
|
+
num = 1
|
|
18
|
+
return `${num}${abbrev[i + 1]}`
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return `${num}${abbrev[i]}`
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return number.toString()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default numabbr
|
package/src/module/object.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
const is = (object) => {
|
|
3
3
|
return object &&
|
|
4
4
|
typeof object === 'object' &&
|
|
5
5
|
Object.getPrototypeOf(object) === Object.getPrototypeOf({})
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const byString = (o, s) => {
|
|
9
9
|
s = s.replace(/\[(\w+)\]/g, '.$1') // convert indexes to properties
|
|
10
10
|
s = s.replace(/^\./, '') // strip a leading dot
|
|
11
11
|
const a = s.split('.')
|
package/src/module/observer.js
CHANGED
|
@@ -25,9 +25,9 @@ const observer = (() => {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const notify = function (event, ...args) {
|
|
28
|
-
if (!
|
|
28
|
+
if (!this.events[event]) return this
|
|
29
29
|
|
|
30
|
-
for (const { context, callback } of
|
|
30
|
+
for (const { context, callback } of this.events[event]) {
|
|
31
31
|
callback.apply(context, args)
|
|
32
32
|
}
|
|
33
33
|
|
package/src/module/passive.js
CHANGED
package/src/module/remove.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import extract from './extract'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* attach function to events
|
|
5
|
-
* @module module/attach
|
|
6
|
-
* @category module
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* [attach description]
|
|
11
|
-
* @param {object} component [description]
|
|
12
|
-
* @param {[type]} events [description]
|
|
13
|
-
* @return {[type]} [description]
|
|
14
|
-
*/
|
|
2
|
+
import last from './last'
|
|
15
3
|
export default {
|
|
16
|
-
remove:
|
|
4
|
+
remove: (events) => {
|
|
17
5
|
// console.log('attach', events)
|
|
18
6
|
events = events || this.options.events
|
|
19
7
|
if (!events) return
|
|
@@ -42,33 +30,10 @@ export default {
|
|
|
42
30
|
} else if (e && e.element && e.element.off && f && bound) {
|
|
43
31
|
e.element.off(e.name, f.bind(bound))
|
|
44
32
|
} else {
|
|
45
|
-
console.trace('can\'t
|
|
46
|
-
console.log('can\'t attach', def[0])
|
|
33
|
+
console.trace('can\'t be removed', def[0])
|
|
47
34
|
}
|
|
48
35
|
})
|
|
49
36
|
|
|
50
37
|
return this
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Return the last reference from an object
|
|
55
|
-
* @param {string} str Object path for example key1.key2.key3
|
|
56
|
-
* @return {value} The value of the last reference
|
|
57
|
-
*/
|
|
58
|
-
last: function (str) {
|
|
59
|
-
// console.log('_path', str)
|
|
60
|
-
if (!str) return this
|
|
61
|
-
else if (!str.match(/\./)) return this[str]
|
|
62
|
-
let last
|
|
63
|
-
|
|
64
|
-
const keys = str.split('.')
|
|
65
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
66
|
-
const key = keys[i]
|
|
67
|
-
|
|
68
|
-
last = last || this
|
|
69
|
-
last = last[key]
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return last
|
|
73
38
|
}
|
|
74
39
|
}
|
package/src/module/request.js
CHANGED
package/src/module/ripple.js
CHANGED
|
@@ -2,7 +2,8 @@ import insert from '../element/insert'
|
|
|
2
2
|
import offset from '../element/offset'
|
|
3
3
|
|
|
4
4
|
const defaults = {
|
|
5
|
-
transition: '.
|
|
5
|
+
// transition: '.375s cubic-bezier(0.4, 0.0, 0.2, 1)',
|
|
6
|
+
transition: '.375s linear',
|
|
6
7
|
opacity: ['1', '.3']
|
|
7
8
|
}
|
|
8
9
|
|
package/src/module/touch.js
CHANGED
package/src/module/utils.js
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions
|
|
3
|
-
* @module module/utils
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Checks if given value is an array
|
|
8
|
-
* @param {*} object
|
|
9
|
-
* @returns {boolean}
|
|
10
|
-
*/
|
|
11
1
|
const isArray = (object) => {
|
|
12
2
|
return Object.prototype.toString.call(object) === '[object Array]'
|
|
13
3
|
}
|
|
14
4
|
|
|
15
|
-
/**
|
|
16
|
-
* Checks if JavaScript object is a plain object
|
|
17
|
-
* @param {Object} object
|
|
18
|
-
* @returns {*|boolean}
|
|
19
|
-
*/
|
|
20
5
|
const isLiteralObject = (object) => {
|
|
21
6
|
return object && typeof object === 'object' && Object.getPrototypeOf(object) === Object.getPrototypeOf({})
|
|
22
7
|
}
|
|
23
8
|
|
|
24
|
-
/**
|
|
25
|
-
* Checks if object is iterable
|
|
26
|
-
* @param {Object} object
|
|
27
|
-
* @returns {boolean}
|
|
28
|
-
*/
|
|
29
9
|
const isIterable = (object) => {
|
|
30
10
|
return isLiteralObject(object) ||
|
|
31
11
|
isArray(object) ||
|
|
@@ -34,11 +14,6 @@ const isIterable = (object) => {
|
|
|
34
14
|
object.length !== undefined)
|
|
35
15
|
}
|
|
36
16
|
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @param {Object} object
|
|
40
|
-
* @param {Function} callback
|
|
41
|
-
*/
|
|
42
17
|
const each = (object, callback) => {
|
|
43
18
|
if (isArray(object) || (typeof object === 'object' && object.length !== undefined)) {
|
|
44
19
|
for (let i = 0, l = object.length; i < l; i++) {
|
|
@@ -54,12 +29,6 @@ const each = (object, callback) => {
|
|
|
54
29
|
}
|
|
55
30
|
}
|
|
56
31
|
|
|
57
|
-
/**
|
|
58
|
-
* Array.indexOf support
|
|
59
|
-
* @param {Array} array
|
|
60
|
-
* @param {*} obj
|
|
61
|
-
* @returns {number}
|
|
62
|
-
*/
|
|
63
32
|
const indexOf = (array, obj) => {
|
|
64
33
|
if (Array.prototype.indexOf) {
|
|
65
34
|
return Array.prototype.indexOf.call(array, obj)
|
package/src/module/viewport.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
function viewport (el) {
|
|
1
|
+
const viewport = el => {
|
|
3
2
|
if (!el) return
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const top = rect.top
|
|
8
|
-
const left = rect.left
|
|
9
|
-
const width = rect.width
|
|
10
|
-
const height = rect.height
|
|
4
|
+
const { top, left, width, height } = el.getBoundingClientRect()
|
|
11
5
|
|
|
12
6
|
return (
|
|
13
7
|
top >= window.pageYOffset &&
|
|
14
8
|
left >= window.pageXOffset &&
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
top + height <= window.pageYOffset + window.innerHeight &&
|
|
10
|
+
left + width <= window.pageXOffset + window.innerWidth
|
|
17
11
|
)
|
|
18
12
|
}
|
|
19
13
|
|
package/src/navigation.js
CHANGED
|
@@ -1,24 +1,74 @@
|
|
|
1
|
+
import EventEmitter from './mixin/emitter'
|
|
2
|
+
|
|
1
3
|
import * as css from './module/css'
|
|
2
4
|
import build from './module/build'
|
|
5
|
+
import attach from './module/attach'
|
|
6
|
+
import display from './mixin/display'
|
|
7
|
+
import Element from './element'
|
|
8
|
+
import Button from './button'
|
|
9
|
+
import Item from './item'
|
|
3
10
|
|
|
4
|
-
class Navigation {
|
|
11
|
+
class Navigation extends EventEmitter {
|
|
5
12
|
static defaults = {
|
|
6
|
-
class: 'navigation'
|
|
13
|
+
class: 'navigation',
|
|
14
|
+
tag: 'nav',
|
|
15
|
+
layout: [
|
|
16
|
+
[Element, 'body', { class: 'body' }]
|
|
17
|
+
],
|
|
18
|
+
events: [
|
|
19
|
+
['element.click', 'toggle']
|
|
20
|
+
]
|
|
7
21
|
}
|
|
8
22
|
|
|
9
23
|
constructor (options) {
|
|
24
|
+
super()
|
|
25
|
+
|
|
10
26
|
this.init(options)
|
|
11
27
|
this.build()
|
|
28
|
+
this.attach()
|
|
12
29
|
this.setup()
|
|
13
30
|
}
|
|
14
31
|
|
|
15
32
|
init (options) {
|
|
16
33
|
this.options = { ...Navigation.defaults, ...options }
|
|
17
|
-
Object.assign(this, build)
|
|
34
|
+
Object.assign(this, build, attach, display)
|
|
35
|
+
this.items = []
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
setup () {
|
|
39
|
+
console.log('setup', this.options)
|
|
40
|
+
if (this.options.type) css.add(this.element, 'type-' + this.options.type)
|
|
41
|
+
if (this.options.type === 'rail') this.show()
|
|
42
|
+
if (this.options.items) this.render(this.options.items)
|
|
18
43
|
}
|
|
19
44
|
|
|
20
|
-
|
|
21
|
-
|
|
45
|
+
render (items) {
|
|
46
|
+
console.log('render', items)
|
|
47
|
+
if (items && Array.isArray(items)) {
|
|
48
|
+
for (let i = 0; i < items.length; i++) {
|
|
49
|
+
this.add(items[i])
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
add (obj) {
|
|
55
|
+
if (typeof obj !== 'object') return this
|
|
56
|
+
let item
|
|
57
|
+
if (obj.type === 'header') {
|
|
58
|
+
item = new Element({ tag: 'span', class: 'header' })
|
|
59
|
+
} else if (obj.type === 'divider') {
|
|
60
|
+
item = new Element({ tag: 'span', class: 'divider' })
|
|
61
|
+
} else {
|
|
62
|
+
obj.container = this.ui.body
|
|
63
|
+
obj.class = 'item'
|
|
64
|
+
obj.stopPropagation = true
|
|
65
|
+
obj.class = 'item'
|
|
66
|
+
item = new Item(obj)
|
|
67
|
+
console.log('item', item, this.items)
|
|
68
|
+
this.items.push(item)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return this
|
|
22
72
|
}
|
|
23
73
|
}
|
|
24
74
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
html
|
|
2
|
+
font-size: 100%
|
|
3
|
+
line-height: 1.15
|
|
4
|
+
width: 100%
|
|
5
|
+
height: 100%
|
|
6
|
+
|
|
7
|
+
body
|
|
8
|
+
color: rgba(0, 0, 0, 0.67)
|
|
9
|
+
font-family: Roboto, arial, serif
|
|
10
|
+
font-size: 100%
|
|
11
|
+
display: flex
|
|
12
|
+
// position: relative
|
|
13
|
+
// display: block
|
|
14
|
+
// height: 100%
|
|
15
|
+
// width: 100%
|
|
16
|
+
// overflow: hidden
|
|
17
|
+
margin: 0
|
|
18
|
+
padding: 0
|
|
19
|
+
// user-select: none
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
// HTML Tags General Defintion
|
|
3
|
+
html
|
|
4
|
+
font-size: 100%
|
|
5
|
+
line-height: 1.15
|
|
6
|
+
width: 100%
|
|
7
|
+
height: 100%
|
|
8
|
+
|
|
9
|
+
body
|
|
10
|
+
color: rgba(0, 0, 0, 0.67)
|
|
11
|
+
font-family: Roboto, arial, serif
|
|
12
|
+
font-size: 100%
|
|
13
|
+
// position: relative
|
|
14
|
+
// display: block
|
|
15
|
+
// height: 100%
|
|
16
|
+
// width: 100%
|
|
17
|
+
// overflow: hidden
|
|
18
|
+
margin: 0
|
|
19
|
+
padding: 0
|
|
20
|
+
// user-select: none
|
|
21
|
+
|
|
22
|
+
input,
|
|
23
|
+
textarea,
|
|
24
|
+
keygen,
|
|
25
|
+
select,
|
|
26
|
+
button
|
|
27
|
+
font-size: 1em
|
|
28
|
+
font-family: Roboto, arial, serif
|
|
29
|
+
color: rgb(51, 51, 51)
|
|
30
|
+
|
|
31
|
+
p
|
|
32
|
+
line-height: 20px
|
|
33
|
+
padding-top: 6px
|
|
34
|
+
margin-bottom: 14px
|
|
35
|
+
letter-spacing: 0
|
|
36
|
+
font-weight: 400
|
|
37
|
+
|
|
38
|
+
// get rid of outline
|
|
39
|
+
select,
|
|
40
|
+
input,
|
|
41
|
+
textarea,
|
|
42
|
+
button
|
|
43
|
+
outline: none
|
|
44
|
+
&:hover
|
|
45
|
+
outline: none
|
|
46
|
+
|
|
47
|
+
button
|
|
48
|
+
user-select: none
|
|
49
|
+
|
|
50
|
+
// set all container boder-box
|
|
51
|
+
*
|
|
52
|
+
box-sizing: border-box
|
|
53
|
+
|
|
54
|
+
a
|
|
55
|
+
color: rgba(0, 0, 0, 0.7)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.elevation-z0
|
|
2
|
+
box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12)
|
|
3
|
+
.elevation-z1
|
|
4
|
+
box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12)
|
|
5
|
+
.elevation-z2
|
|
6
|
+
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)
|
|
7
|
+
.elevation-z3
|
|
8
|
+
box-shadow: 0px 3px 3px -2px rgba(0, 0, 0, 0.2), 0px 3px 4px 0px rgba(0, 0, 0, 0.14), 0px 1px 8px 0px rgba(0, 0, 0, 0.12)
|
|
9
|
+
.elevation-z4
|
|
10
|
+
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)
|
|
11
|
+
.elevation-z5
|
|
12
|
+
box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 5px 8px 0px rgba(0, 0, 0, 0.14), 0px 1px 14px 0px rgba(0, 0, 0, 0.12)
|
|
13
|
+
.elevation-z6
|
|
14
|
+
box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12)
|
|
15
|
+
.elevation-z7
|
|
16
|
+
box-shadow: 0px 4px 5px -2px rgba(0, 0, 0, 0.2), 0px 7px 10px 1px rgba(0, 0, 0, 0.14), 0px 2px 16px 1px rgba(0, 0, 0, 0.12)
|
|
17
|
+
.elevation-z8
|
|
18
|
+
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)
|
|
19
|
+
.elevation-z9
|
|
20
|
+
box-shadow: 0px 5px 6px -3px rgba(0, 0, 0, 0.2), 0px 9px 12px 1px rgba(0, 0, 0, 0.14), 0px 3px 16px 2px rgba(0, 0, 0, 0.12)
|
|
21
|
+
.elevation-z10
|
|
22
|
+
box-shadow: 0px 6px 6px -3px rgba(0, 0, 0, 0.2), 0px 10px 14px 1px rgba(0, 0, 0, 0.14), 0px 4px 18px 3px rgba(0, 0, 0, 0.12)
|
|
23
|
+
.elevation-z11
|
|
24
|
+
box-shadow: 0px 6px 7px -4px rgba(0, 0, 0, 0.2), 0px 11px 15px 1px rgba(0, 0, 0, 0.14), 0px 4px 20px 3px rgba(0, 0, 0, 0.12)
|
|
25
|
+
.elevation-z12
|
|
26
|
+
box-shadow: 0px 7px 8px -4px rgba(0, 0, 0, 0.2), 0px 12px 17px 2px rgba(0, 0, 0, 0.14), 0px 5px 22px 4px rgba(0, 0, 0, 0.12)
|
|
27
|
+
.elevation-z13
|
|
28
|
+
box-shadow: 0px 7px 8px -4px rgba(0, 0, 0, 0.2), 0px 13px 19px 2px rgba(0, 0, 0, 0.14), 0px 5px 24px 4px rgba(0, 0, 0, 0.12)
|
|
29
|
+
.elevation-z14
|
|
30
|
+
box-shadow: 0px 7px 9px -4px rgba(0, 0, 0, 0.2), 0px 14px 21px 2px rgba(0, 0, 0, 0.14), 0px 5px 26px 4px rgba(0, 0, 0, 0.12)
|
|
31
|
+
.elevation-z15
|
|
32
|
+
box-shadow: 0px 8px 9px -5px rgba(0, 0, 0, 0.2), 0px 15px 22px 2px rgba(0, 0, 0, 0.14), 0px 6px 28px 5px rgba(0, 0, 0, 0.12)
|
|
33
|
+
.elevation-z16
|
|
34
|
+
box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, 0.2), 0px 16px 24px 2px rgba(0, 0, 0, 0.14), 0px 6px 30px 5px rgba(0, 0, 0, 0.12)
|
|
35
|
+
.elevation-z17
|
|
36
|
+
box-shadow: 0px 8px 11px -5px rgba(0, 0, 0, 0.2), 0px 17px 26px 2px rgba(0, 0, 0, 0.14), 0px 6px 32px 5px rgba(0, 0, 0, 0.12)
|
|
37
|
+
.elevation-z18
|
|
38
|
+
box-shadow: 0px 9px 11px -5px rgba(0, 0, 0, 0.2), 0px 18px 28px 2px rgba(0, 0, 0, 0.14), 0px 7px 34px 6px rgba(0, 0, 0, 0.12)
|
|
39
|
+
.elevation-z19
|
|
40
|
+
box-shadow: 0px 9px 12px -6px rgba(0, 0, 0, 0.2), 0px 19px 29px 2px rgba(0, 0, 0, 0.14), 0px 7px 36px 6px rgba(0, 0, 0, 0.12)
|
|
41
|
+
.elevation-z20
|
|
42
|
+
box-shadow: 0px 10px 13px -6px rgba(0, 0, 0, 0.2), 0px 20px 31px 3px rgba(0, 0, 0, 0.14), 0px 8px 38px 7px rgba(0, 0, 0, 0.12)
|
|
43
|
+
.elevation-z21
|
|
44
|
+
box-shadow: 0px 10px 13px -6px rgba(0, 0, 0, 0.2), 0px 21px 33px 3px rgba(0, 0, 0, 0.14), 0px 8px 40px 7px rgba(0, 0, 0, 0.12)
|
|
45
|
+
.elevation-z22
|
|
46
|
+
box-shadow: 0px 10px 14px -6px rgba(0, 0, 0, 0.2), 0px 22px 35px 3px rgba(0, 0, 0, 0.14), 0px 8px 42px 7px rgba(0, 0, 0, 0.12)
|
|
47
|
+
.elevation-z23
|
|
48
|
+
box-shadow: 0px 11px 14px -7px rgba(0, 0, 0, 0.2), 0px 23px 36px 3px rgba(0, 0, 0, 0.14), 0px 9px 44px 8px rgba(0, 0, 0, 0.12)
|
|
49
|
+
.elevation-z24
|
|
50
|
+
box-shadow: 0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/////////////////
|
|
2
|
+
// Semantic.gs // for SCSS: http://sass-lang.com/
|
|
3
|
+
/////////////////
|
|
4
|
+
|
|
5
|
+
// Defaults which you can freely override
|
|
6
|
+
$column-width: 60px
|
|
7
|
+
$gutter-width: 20px
|
|
8
|
+
$columns: 12
|
|
9
|
+
|
|
10
|
+
// Utility function — you should never need to modify this
|
|
11
|
+
@function gridsystem-width($columns:$columns)
|
|
12
|
+
@return ($column-width * $columns) + ($gutter-width * $columns)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// Set $total-width to 100% for a fluid layout
|
|
16
|
+
$total-width: gridsystem-width($columns)
|
|
17
|
+
|
|
18
|
+
// Uncomment these two lines and the star-hack width/margin lines below to enable sub-pixel fix for IE6 & 7. See http://tylertate.com/blog/2012/01/05/subpixel-rounding.html
|
|
19
|
+
// $min-width: 999999
|
|
20
|
+
// $correction: 0.5 / $min-width * 100
|
|
21
|
+
|
|
22
|
+
// The micro clearfix http://nicolasgallagher.com/micro-clearfix-hack/
|
|
23
|
+
@mixin clearfix()
|
|
24
|
+
*zoom:1
|
|
25
|
+
|
|
26
|
+
&:before,
|
|
27
|
+
&:after
|
|
28
|
+
content:""
|
|
29
|
+
display:table
|
|
30
|
+
|
|
31
|
+
&:after
|
|
32
|
+
clear:both
|
|
33
|
+
|
|
34
|
+
//////////
|
|
35
|
+
// GRID //
|
|
36
|
+
//////////
|
|
37
|
+
|
|
38
|
+
body
|
|
39
|
+
width: 100%
|
|
40
|
+
@include clearfix()
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@mixin row($columns:$columns)
|
|
44
|
+
display: block
|
|
45
|
+
width: $total-width*(($gutter-width + gridsystem-width($columns))/gridsystem-width($columns))
|
|
46
|
+
margin: 0 $total-width*((($gutter-width*.5)/gridsystem-width($columns))*-1)
|
|
47
|
+
// *width: $total-width*(($gutter-width + gridsystem-width($columns))/gridsystem-width($columns))-$correction
|
|
48
|
+
// *margin: 0 $total-width*((($gutter-width*.5)/gridsystem-width($columns))*-1)-$correction
|
|
49
|
+
@include clearfix()
|
|
50
|
+
|
|
51
|
+
@mixin column($x,$columns:$columns)
|
|
52
|
+
display: inline
|
|
53
|
+
float: left
|
|
54
|
+
width: $total-width*(((($gutter-width+$column-width)*$x)-$gutter-width) / gridsystem-width($columns))
|
|
55
|
+
margin: 0 $total-width*(($gutter-width*.5)/gridsystem-width($columns))
|
|
56
|
+
// *width: $total-width*(((($gutter-width+$column-width)*$x)-$gutter-width) / gridsystem-width($columns))-$correction
|
|
57
|
+
// *margin: 0 $total-width*(($gutter-width*.5)/gridsystem-width($columns))-$correction
|
|
58
|
+
|
|
59
|
+
@mixin push($offset:1)
|
|
60
|
+
margin-left: $total-width*((($gutter-width+$column-width)*$offset) / gridsystem-width($columns)) + $total-width*(($gutter-width*.5)/gridsystem-width($columns))
|
|
61
|
+
|
|
62
|
+
@mixin pull($offset:1)
|
|
63
|
+
margin-right: $total-width*((($gutter-width+$column-width)*$offset) / gridsystem-width($columns)) + $total-width*(($gutter-width*.5)/gridsystem-width($columns))
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
.material-text
|
|
2
|
+
&.type-display4
|
|
3
|
+
font-size: 7rem
|
|
4
|
+
font-weight: 300
|
|
5
|
+
letter-spacing: -0.04em
|
|
6
|
+
line-height: 7rem
|
|
7
|
+
|
|
8
|
+
&.type-display3
|
|
9
|
+
font-size: 3.5rem
|
|
10
|
+
font-weight: 400
|
|
11
|
+
letter-spacing: -0.02em
|
|
12
|
+
line-height: 3.5rem
|
|
13
|
+
|
|
14
|
+
&.type-display2
|
|
15
|
+
font-size: 2.813rem
|
|
16
|
+
font-weight: 400
|
|
17
|
+
letter-spacing: normal
|
|
18
|
+
line-height: 3rem
|
|
19
|
+
|
|
20
|
+
&.type-display1
|
|
21
|
+
font-size: 2.125rem
|
|
22
|
+
font-weight: 400
|
|
23
|
+
letter-spacing: normal
|
|
24
|
+
line-height: 2.5rem
|
|
25
|
+
|
|
26
|
+
&.type-headline
|
|
27
|
+
font-size: 1.5rem
|
|
28
|
+
font-weight: 400
|
|
29
|
+
letter-spacing: normal
|
|
30
|
+
line-height: 2rem
|
|
31
|
+
|
|
32
|
+
&.type-title
|
|
33
|
+
font-size: 1.25rem
|
|
34
|
+
font-weight: 500
|
|
35
|
+
letter-spacing: 0.02em
|
|
36
|
+
line-height: 2rem
|
|
37
|
+
|
|
38
|
+
&.type-subheading2
|
|
39
|
+
font-size: 1rem
|
|
40
|
+
font-weight: 400
|
|
41
|
+
letter-spacing: 0.04em
|
|
42
|
+
line-height: 1.75rem
|
|
43
|
+
|
|
44
|
+
&.type-subheading1
|
|
45
|
+
font-size: 0.938rem
|
|
46
|
+
font-weight: 400
|
|
47
|
+
letter-spacing: 0.04em
|
|
48
|
+
line-height: 1.5rem
|
|
49
|
+
|
|
50
|
+
&.type-body1
|
|
51
|
+
font-size: 0.875rem
|
|
52
|
+
font-weight: 400
|
|
53
|
+
letter-spacing: 0.04em
|
|
54
|
+
line-height: 1.25rem
|
|
55
|
+
|
|
56
|
+
&.type-body2
|
|
57
|
+
font-size: 0.875rem
|
|
58
|
+
font-weight: 500
|
|
59
|
+
letter-spacing: 0.04em
|
|
60
|
+
line-height: 1.5rem
|
|
61
|
+
|
|
62
|
+
&.type-caption
|
|
63
|
+
font-size: 0.75rem
|
|
64
|
+
font-weight: 400
|
|
65
|
+
letter-spacing: 0.08em
|
|
66
|
+
line-height: 1.25rem
|
|
67
|
+
|
|
68
|
+
&.type-button
|
|
69
|
+
font-size: 14px
|
|
70
|
+
font-weight: 500
|
|
71
|
+
|
|
72
|
+
// margin-bottom: 30px;
|
|
73
|
+
margin-left: 8px
|
|
74
|
+
|
|
75
|
+
&.style-adjust
|
|
76
|
+
&.type-display4
|
|
77
|
+
margin: -1rem 0 3.5rem -0.085em
|
|
78
|
+
|
|
79
|
+
&.type-display3
|
|
80
|
+
margin: -8px 0 64px -0.07em
|
|
81
|
+
|
|
82
|
+
&.type-display2
|
|
83
|
+
margin: -0.5rem 0 4rem -0.07em
|
|
84
|
+
|
|
85
|
+
&.type-display1
|
|
86
|
+
margin: -0.5rem 0 4rem -0.07em
|
|
87
|
+
|
|
88
|
+
&.type-headline
|
|
89
|
+
margin: -0.5rem 0 1rem -0.06em
|
|
90
|
+
|
|
91
|
+
&.type-title
|
|
92
|
+
margin: -0.5rem 0 1rem -0.05em
|
|
93
|
+
|
|
94
|
+
&.type-subheading2
|
|
95
|
+
margin: -0.5rem 0 1rem -0.06em
|
|
96
|
+
|
|
97
|
+
&.type-subheading1
|
|
98
|
+
margin: -0.313rem 0 0.813rem -0.06em
|
|
99
|
+
|
|
100
|
+
&.type-body1
|
|
101
|
+
margin: -0.25rem 0 0.75rem 0
|
|
102
|
+
|
|
103
|
+
&.type-body2
|
|
104
|
+
margin: -0.25rem 0 0.75rem 0
|
|
105
|
+
|
|
106
|
+
&.type-caption
|
|
107
|
+
line-height: 1.25rem
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
font-size: 0.875rem
|
|
3
3
|
font-weight: 500
|
|
4
4
|
color: $text-on-primary
|
|
5
|
+
line-height: 20px
|
|
5
6
|
height: 40px
|
|
7
|
+
display: inline-flex
|
|
8
|
+
align-items: center
|
|
9
|
+
justify-content: center
|
|
10
|
+
position: relative
|
|
6
11
|
background-color: $color-primary
|
|
7
12
|
padding-left: 24px
|
|
8
13
|
padding-right: 24px
|
|
14
|
+
margin: 0 4px
|
|
9
15
|
border-radius: 20px
|
|
10
16
|
border: none
|
|
11
17
|
overflow: hidden
|
|
@@ -17,10 +23,17 @@
|
|
|
17
23
|
background-color: $color-tonal
|
|
18
24
|
&.style-elevated
|
|
19
25
|
background-color: $color-primary
|
|
20
|
-
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px
|
|
26
|
+
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 3px 0 rgba(0, 0, 0, 0.12)
|
|
27
|
+
&:active
|
|
28
|
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 3px 0 rgba(0, 0, 0, 0.12)
|
|
21
29
|
&.style-outlined
|
|
22
30
|
color: $color-primary
|
|
23
31
|
background-color: transparent
|
|
24
|
-
border
|
|
32
|
+
border: 1px solid #72776C
|
|
33
|
+
&:hover
|
|
34
|
+
background-color: $color-tonal
|
|
25
35
|
&.style-text
|
|
26
36
|
color: $color-primary
|
|
37
|
+
background-color: transparent
|
|
38
|
+
&:hover
|
|
39
|
+
background-color: $color-tonal
|