vendor dependencies with dep

This commit is contained in:
dhax 2017-09-25 20:20:52 +02:00
parent 93d8310491
commit 1384296a47
2712 changed files with 965742 additions and 0 deletions

View file

@ -0,0 +1,24 @@
package premailer
import (
"github.com/vanng822/css"
)
func copyRule(selector string, rule *css.CSSRule) *css.CSSRule {
// copy rule for each selector
styles := make(map[string]*css.CSSStyleDeclaration)
for prop, s := range rule.Style.Styles {
styles[prop] = css.NewCSSStyleDeclaration(s.Property, s.Value, s.Important)
}
copiedStyle := css.CSSStyleRule{SelectorText: selector, Styles: styles}
copiedRule := &css.CSSRule{Type: rule.Type, Style: copiedStyle}
return copiedRule
}
func makeRuleImportant(rule *css.CSSRule) string {
// this for using Text() which has nice sorted props
for _, s := range rule.Style.Styles {
s.Important = 1
}
return rule.Style.Text()
}