Skip to content

Commit

Permalink
Merge pull request #1144 from mads-hartmann/fresh-coat-of-paint
Browse files Browse the repository at this point in the history
Style the page using the colors from the scalameta logo
  • Loading branch information
olafurpg committed Apr 23, 2018
2 parents 367170b + b5e6484 commit 5a14343
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 8 deletions.
7 changes: 3 additions & 4 deletions readme/Intro.scalatex
Expand Up @@ -10,10 +10,9 @@
@blockquote
Any style guide written in English is either so brief that it’s ambiguous,
or so long that no one reads it.

@blockquote
-- Bob Nystrom, @lnk("\"Hardest Program I've Ever Written\"", "http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/"),
Dart, Google.
@small
-- Bob Nystrom, @lnk("\"Hardest Program I've Ever Written\"", "http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/"),
Dart, Google.

@p
@lnk("Scalafmt", repo) turns the mess on the left into the (hopefully)
Expand Down
7 changes: 5 additions & 2 deletions readme/Readme.scalatex
Expand Up @@ -3,7 +3,10 @@
@import org.scalafmt.config.ScalafmtConfig
@import org.scalafmt.config.ScalafmtConfig.default

@sect("Scalafmt - code formatter for Scala", org.scalafmt.Versions.stable)
@raw
<link rel="stylesheet" href="custom.css" />

@sect("Scalafmt", org.scalafmt.Versions.stable)

@scalatex.Intro()
@scalatex.Installation()
Expand All @@ -16,4 +19,4 @@
@scalatex.Footer()

@raw
<a href="https://github.com/scalameta/scalafmt"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>
<a href="https://github.com/scalameta/scalafmt"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
128 changes: 128 additions & 0 deletions readme/resources/custom.css
@@ -0,0 +1,128 @@

/**
* Menu
*/

.scalatex-scrollspy-Styles-menu {
/* Can't override the width in CSS as it's manipulated in JS when the menu is
collapsed. */
/* width: 350px !important; */
}

.scalatex-scrollspy-Styles-selected {
background: #af2442;
}

.scalatex-scrollspy-Styles-closed {
color: white;
}

.scalatex-scrollspy-Styles-selected {
background: #eb4d54;
}
.scalatex-scrollspy-Styles-pathed {
border-left: none;
}

.scalatex-scrollspy-Styles-menuLink,
.scalatex-scrollspy-Styles-menuLink:hover {
background: #eb4d54;
}

.scalatex-scrollspy-Styles-menu {
background: #eb4d54;
}

.scalatex-scrollspy-Styles-note {
color: white;
font-weight: 300;
}

.scalatex-scrollspy-Styles-noteBox {
background: #eb4d54;
padding-bottom: 10px;
text-align: center;
}

.scalatex-scrollspy-Styles-menuItem {
border-bottom: none;
}

.scalatex-scrollspy-Styles-menuItem:hover {
background: #eb4d54;
color: white;
}

ul.menu-item-list {
background: #af2442;
border-right: 2px solid #eb4d54;
}

/**
* Content
*/


.scalatex-site-Styles-hoverContainer.scalatex-site-Styles-headerTag {
border-bottom: none !important;
line-height: 2em;
margin: 0;
}

.scalatex-site-Styles-content {
max-width: 1000px;
color: black;

color: rgba(46,48,58,0.96);
}

.scalatex-site-Styles-content p {
font-size: 1.2rem;
line-height: 1.7rem;
}

.scalatex-site-Styles-content a:visited,
.scalatex-site-Styles-content a:link {
color: #eb4d54;
}

.scalatex-site-Styles-content pre code {
padding: 1em 20px;
background: transparent;
background: #f9f9f9;
border-left: 10px solid #ccc;
}

.scalafmt-pair {
background: #f9f9f9;
border-left: 10px solid #ccc;
display: flex;
justify-content: space-around;
}

/** Ovrride pre code styling in case of pair split as it's taken caore of by
* .scalafmt-pair*/
.scalatex-site-Styles-content .scalafmt-pair pre code {
background: transparent;
border-left: none;
}

blockquote {
background: #f9f9f9;
border-left: 10px solid #ccc;
margin: 1.5em 0px;
padding: 1em 20px;
quotes: "“" "”" "‘" "’";
}

blockquote:before {
color: #eb4d54;
content: open-quote;
font-size: 4em;
line-height: 0.1em;
vertical-align: -0.4em;
}

blockquote small {
display: block;
}
4 changes: 2 additions & 2 deletions readme/src/main/scala/org/scalafmt/readme/Readme.scala
Expand Up @@ -83,10 +83,10 @@ object Readme {
def issue(id: Int) = a(href := repo + s"/issues/$id", s"#$id")
def issues(ids: Int*) = span(ids.map(issue): _*)

def half(frags: Frag*) = div(frags, width := "50%", float.left)
def half(frags: Frag*) = div(frags)
def ignore(frags: Frag*) = span("")

def pairs(frags: Frag*) = div(frags, div(clear := "both"))
def pairs(frags: Frag*) = div(frags, `class` := "scalafmt-pair")

def sideBySide(left: String, right: String) =
pairs(List(left, right).map(x => half(hl.scala(x))): _*)
Expand Down

0 comments on commit 5a14343

Please sign in to comment.