Commit Graph

21 Commits

Author SHA1 Message Date
David A. Kennedy
7d70dabf59 Twenty Seventeen: Ensure functions in customize-controls.js don't count on Customizer sections always being present
Before, the code assumed the `theme_options` section is always present, but it can be removed by plugins. This way, if it is, no JavaScript errors occur.

Props westonruter.

Fixes #39335.

Built from https://develop.svn.wordpress.org/trunk@39623


git-svn-id: http://core.svn.wordpress.org/trunk@39563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-20 22:17:40 +00:00
Helen Hou-Sandí
f048b66f95 Twenty Seventeen: Improve ARIA for the nav menu.
The `onResizeARIA()` function was not very useful and buggy.

props afercia.
fixes #39029, #39026.

Built from https://develop.svn.wordpress.org/trunk@39451


git-svn-id: http://core.svn.wordpress.org/trunk@39391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-03 03:41:41 +00:00
David A. Kennedy
5edaa49d99 Twenty Seventeen: Ensure header text color updates in Customizer preview when cleared
Checks if the text color has been cleared and removes the `style` block if it has been. Uses color styles in theme stylesheet.

Props sstoqnov, davidakennedy.

Fixes #38993.

Built from https://develop.svn.wordpress.org/trunk@39447


git-svn-id: http://core.svn.wordpress.org/trunk@39387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-02 23:01:43 +00:00
David A. Kennedy
c0a9b1e57f Twenty Seventeen: Fix broken menu toggle in Customizer after menu items are added
This simplifies the line `$( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' );` to `$( siteNavContain ).toggleClass( 'toggled-on' );`, since `this` is the clicked button, so the extra context isn't needed.

Props afercia, laurelfulford.

Fixes #38992.

Built from https://develop.svn.wordpress.org/trunk@39419


git-svn-id: http://core.svn.wordpress.org/trunk@39359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-02 06:25:42 +00:00
David A. Kennedy
853acee460 Twenty Seventeen: Hide front section panels on page load of Customizer.
Props sstoqnov.

Fixes #38951.

Built from https://develop.svn.wordpress.org/trunk@39417


git-svn-id: http://core.svn.wordpress.org/trunk@39357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-02 05:57:43 +00:00
Joe McGill
e2b7762e9a Twenty Seventeen: Better handling of custom headers when no image is set.
This ensures that a standard header is shown on the front page whenever
a header video is set without a header image if the video doesn't load,
e.g., on mobile sizes or if the JS doesn't fire.

This adds a new class, `.has-header-video` that is added whenever the
`wp-custom-header-video-loaded` event is fired, which is then used to style
the custom headers along with `.has-header-image` whenever a header image
is available. This also changes the class name on the custom header media
wrapping `div` from `.custom-header-image` to `.custom-header-media`.

Props laurelfulford, joemcgill.
Fixes #38995.
Built from https://develop.svn.wordpress.org/trunk@39413


git-svn-id: http://core.svn.wordpress.org/trunk@39353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-02 05:12:41 +00:00
David A. Kennedy
aaf3fe71dd Twenty Seventeen: Adds background-attachment: fixed; to devices that should support it
iOS  disables this feature under the hood, but it also distorts the images – unlike other mobile devices that don't support it. So this adds a  check for both `background-attachment: fixed` support or whether it’s an iOS device - passing it adds the class `background-fixed` which is used to add the proper styles.

It also lowers the media query so the parallax-like style is present on a wider range of screens since this bug can be better targeted and avoided. In this way, screens that aren't the offending devices aren't punished merely based on screen size.

Props joemcgill, laurelfulford, helen.

Fixes #38395.

Built from https://develop.svn.wordpress.org/trunk@39297


git-svn-id: http://core.svn.wordpress.org/trunk@39237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-18 20:11:30 +00:00
Tammie Lister
56723c61c6 Twenty Seventeen: Fix for mobile menu parent items requiring double tap
After further review from the accessibility team, it was determined that the menu items with sub-menus don't need the aria-haspopup attribute.

Props davidakennedy, celloexpressions, voldemortensen, afercia
See #38397


Built from https://develop.svn.wordpress.org/trunk@39232


git-svn-id: http://core.svn.wordpress.org/trunk@39172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-14 22:34:31 +00:00
Tammie Lister
9e110f8aed Twenty Seventeen: Resolves focused controls hidden by the top menu.
When a page is scrolled, the top nav menu become fixed. Depending on the page content this caused issue where focused links or buttons may be hidden behind the  nav menu.

Props afercia, davidakennedy, Fencer04
Fixes #38476


Built from https://develop.svn.wordpress.org/trunk@39225


git-svn-id: http://core.svn.wordpress.org/trunk@39165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-14 17:01:30 +00:00
David A. Kennedy
b6e848e638 Twenty Seventeen: Make sure theme JavaScript follows proper coding standards
Props sstoqnov, afercia.

Fixes #38752.

Built from https://develop.svn.wordpress.org/trunk@39221


git-svn-id: http://core.svn.wordpress.org/trunk@39161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-14 11:41:31 +00:00
David A. Kennedy
f5cdba121f Twenty Seventeen: Make custom header preview match front end in Customizer when changed
* Toggles `has-header-image` body class  in Customizer preview whenever images or videos are added or removed.
* Hides the `.custom-header-image`div in CSS when an image or video haven't been set so preview changes are smoother.
* Also fixes the main issues in #38391 – making the preview match.

Props bradyvercher.

Fixes #38627.
See #38391.

Built from https://develop.svn.wordpress.org/trunk@39220


git-svn-id: http://core.svn.wordpress.org/trunk@39160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-14 11:23:32 +00:00
Tammie Lister
8e3e901559 Twenty Seventeen fix for Travis Error
Removed semi-colo on line 46

Props swissspidy

Built from https://develop.svn.wordpress.org/trunk@39184


git-svn-id: http://core.svn.wordpress.org/trunk@39124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-09 16:55:31 +00:00
Tammie Lister
6c435f5afb Twenty Seventeen: Fixes focused controls hidden by top menu.
When a page is scrolled, the top nav menu became fixed. This resolves that.

Props afercia, Fencer04, davidakennedy
Fixes #38476


Built from https://develop.svn.wordpress.org/trunk@39183


git-svn-id: http://core.svn.wordpress.org/trunk@39123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-09 16:13:34 +00:00
David A. Kennedy
495b2d835f Twenty Seventeen: Make sure skip link works in all versions of Internet Explorer
This also reduces the number of browsers detected and patched with this fix. Most modern browsers have patched this common bug, where an anchor link does not move focus when clicked. Twenty Seventeen will only worry about older versions of Internet Explorer in this regard.

Props afercia, sami.keijonen.

See #38604.

Built from https://develop.svn.wordpress.org/trunk@39135


git-svn-id: http://core.svn.wordpress.org/trunk@39075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-04 17:15:55 +00:00
David A. Kennedy
4b3a9de5b5 Twenty Seventeen: Fix supportsInlineSVG() being unnecessarily called twice
* Also, fix spacing inconsistency in comment.

Props tywayne.

Fixes #38556.

Built from https://develop.svn.wordpress.org/trunk@39081


git-svn-id: http://core.svn.wordpress.org/trunk@39023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 21:24:30 +00:00
David A. Kennedy
906eb80953 Twenty Seventeen: Remove unnecessary l10n variables
* Relies on header skip link instead of l10n variables in JavaScript.
* Fixes issue where scroll down arrow appeared next to the navigation on the front page with no header image or video. It now only appears with a big header.

Props enodekciw, laurelfulford.

Fixes #38502.

Built from https://develop.svn.wordpress.org/trunk@39073


git-svn-id: http://core.svn.wordpress.org/trunk@39015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 19:00:32 +00:00
David A. Kennedy
769e718d2c Twenty Seventeen: Improve user and developer experience with the customizer integration
* Rename customizer JS files to customize-preview.js and customize-controls.js to align with the core file naming and make it clearer where each file runs.
* Only show the colorscheme_hue control when there's a custom color scheme.
* Update preview JS handling for revised front page section handling, see below.
* Remove all references to "Theme Customizer" in code comments. It hasn't been called that since before 4.0.
* Clarify the purpose of the JS files by updated the code comments in the file headers.
* Improve code readability.
* Make the arbitrary number of front page sections filterable, for UI registration and output.
* Rename twentyseventeen_sanitize_layout to twentyseventeen_sanitize_page_layout to be clearer about what it sanitizes in case child themes or plugins consider reusing it.
* Rename page_options setting/control to page_layout as that's more reflective of what that option does; and again, helps for potential extensions.
* Make the page layout option contextual to pages and the sidebar being inactive, as the option only applies when there is no sidebar (per its description).
* Condense options into a single section.
* Add selective refresh for front page sections.
* Locate active_callback functions within customizer.php so that they're easier to find when editing customizer registrations, similarly to sanitize callbacks.
* Adjust the styling for placeholders for panels that aren't active. 
* Ensure that the new visible edit shortcuts don't have any issues.

Props celloexpressions.

Fixes #38426.

Built from https://develop.svn.wordpress.org/trunk@38986


git-svn-id: http://core.svn.wordpress.org/trunk@38929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 22:09:40 +00:00
David A. Kennedy
a6df2cced5 Twenty Seventeen: Fix header height on sub-pages.
Moves `setNavProps` so it's no longer only fired on load when the scroll down arrow is present.

Props laurelfulford.

Fixes #38496.

Built from https://develop.svn.wordpress.org/trunk@38964


git-svn-id: http://core.svn.wordpress.org/trunk@38907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 17:39:31 +00:00
Tammie Lister
67dbadd476 Twenty Seventeen: Display scroll down arrow when no menu
This improves scrollability without a menu.

Props nnaimov, melchoyce, davidakennedy
Fixes #38392


Built from https://develop.svn.wordpress.org/trunk@38909


git-svn-id: http://core.svn.wordpress.org/trunk@38852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 16:51:35 +00:00
David A. Kennedy
5452a6a21d Twenty Seventeen: Fix smooth scrolling skip link
The link was scrolling too far. The main problem was that the `menuTop` variable lost it's initial definition of `0`, so all future subtractions were failing.

Props tywayne.

Fixes #38448.

Built from https://develop.svn.wordpress.org/trunk@38886


git-svn-id: http://core.svn.wordpress.org/trunk@38829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 17:59:47 +00:00
David A. Kennedy
7fbb094586 Importing Twenty Seventeen, our new default theme for 2017, set for 4.7.
With a focus on business sites, it will let you get down to business in style. Initial development occurred on GitHub. See: https://github.com/WordPress/twentyseventeen

Props melchoyce, laurelfulford, davidakennedy, grapplerulrich, manishsongirkar36, joefusco, smyoon315, b-07, rabmalin, mrahmadawais, hardeepasrani, implenton, acmethemes, claudiosanches, valeriutihai, pressionate, sgr33n, doughamlin, zodiac1978, tsl143, nikschavan, joshcummingsdesign, enodekciw, jordesign, patilvikasj, ryelle, mahesh901122, williampatton, juanfra, imnok, littlebigthing, mor10, samikeijonen, celloexpressions, akshayvinchurkar, davidmosterd, hiddenpearls, netweb, pratikchaskar, taggon, nukaga, ranh, yoavf, karmatosed, sandesh055, adammacias, noplanman, yogasukma, binarymoon, swapnilld, swissspidy, joyously, allancole, rianrietveld, sixhours, alex27, themeshaper, mapk, leobaiano.

See #38372.

Built from https://develop.svn.wordpress.org/trunk@38833


git-svn-id: http://core.svn.wordpress.org/trunk@38776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 04:12:31 +00:00