Skip to content

Commit 89de8f3

Browse files
committed
Twenty Thirteen: Add gradient background options using the theme color scheme.
This change implements gradient background options that fit the color scheme used in Twenty Thirteen. Props ianbelanger, tomjdevisser, audrasjb. Fixes #49762. git-svn-id: https://develop.svn.wordpress.org/trunk@52928 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 43275e1 commit 89de8f3

3 files changed

Lines changed: 53 additions & 0 deletions

File tree

src/wp-content/themes/twentythirteen/css/editor-style.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ body {
4040
vertical-align: baseline;
4141
}
4242

43+
/* Custom gradient block backgrounds */
44+
.has-autumn-brown-gradient-background {
45+
background: linear-gradient(135deg, rgba(226,45,15,1) 0%, rgba(158,25,13,1) 100%);
46+
}
47+
.has-sunset-yellow-gradient-background {
48+
background: linear-gradient(135deg, rgba(233,139,41,1) 0%, rgba(238,179,95,1) 100%);
49+
}
50+
.has-light-sky-gradient-background {
51+
background: linear-gradient(135deg,rgba(228,228,228,1.0) 0%,rgba(208,225,252,1.0) 100%);
52+
}
53+
.has-dark-sky-gradient-background {
54+
background: linear-gradient(135deg,rgba(0,0,0,1.0) 0%,rgba(56,61,69,1.0) 100%);
55+
}
4356

4457
/**
4558
* 2.0 Headings

src/wp-content/themes/twentythirteen/functions.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,33 @@ function twentythirteen_setup() {
158158
)
159159
);
160160

161+
// Add support for block gradient colors.
162+
add_theme_support(
163+
'editor-gradient-presets',
164+
array(
165+
array(
166+
'name' => __( 'Autumn Brown', 'twentythirteen' ),
167+
'gradient' => 'linear-gradient(135deg, rgba(226,45,15,1) 0%, rgba(158,25,13,1) 100%)',
168+
'slug' => 'autumn-brown',
169+
),
170+
array(
171+
'name' => __( 'Sunset Yellow', 'twentythirteen' ),
172+
'gradient' => 'linear-gradient(135deg, rgba(233,139,41,1) 0%, rgba(238,179,95,1) 100%)',
173+
'slug' => 'sunset-yellow',
174+
),
175+
array(
176+
'name' => __( 'Light Sky', 'twentythirteen' ),
177+
'gradient' => 'linear-gradient(135deg,rgba(228,228,228,1.0) 0%,rgba(208,225,252,1.0) 100%)',
178+
'slug' => 'light-sky',
179+
),
180+
array(
181+
'name' => __( 'Dark Sky', 'twentythirteen' ),
182+
'gradient' => 'linear-gradient(135deg,rgba(0,0,0,1.0) 0%,rgba(56,61,69,1.0) 100%)',
183+
'slug' => 'dark-sky',
184+
),
185+
)
186+
);
187+
161188
// Adds RSS feed links to <head> for posts and comments.
162189
add_theme_support( 'automatic-feed-links' );
163190

src/wp-content/themes/twentythirteen/style.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,19 @@ hr {
465465
margin: 0 0 24px;
466466
}
467467

468+
/* Custom gradient block backgrounds */
469+
.has-autumn-brown-gradient-background {
470+
background: linear-gradient(135deg, rgba(226,45,15,1) 0%, rgba(158,25,13,1) 100%);
471+
}
472+
.has-sunset-yellow-gradient-background {
473+
background: linear-gradient(135deg, rgba(233,139,41,1) 0%, rgba(238,179,95,1) 100%);
474+
}
475+
.has-light-sky-gradient-background {
476+
background: linear-gradient(135deg,rgba(228,228,228,1.0) 0%,rgba(208,225,252,1.0) 100%);
477+
}
478+
.has-dark-sky-gradient-background {
479+
background: linear-gradient(135deg,rgba(0,0,0,1.0) 0%,rgba(56,61,69,1.0) 100%);
480+
}
468481

469482
/**
470483
* 2.0 Repeatable Patterns

0 commit comments

Comments
 (0)