Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Inline Styles from our ACF Blocks #408

Closed
coreymcollins opened this issue Oct 4, 2018 · 3 comments
Closed

Remove Inline Styles from our ACF Blocks #408

coreymcollins opened this issue Oct 4, 2018 · 3 comments

Comments

@coreymcollins
Copy link
Contributor

A general plan of attack:

  • Stop using the ACF color picker and instead use a filtered & styled select dropdown with defined colors. We already define colors and hide the color picker, so why not just go the next step and stop using the color picker all together? This would also eliminate the need for admin JS.
  • This allows us to set class names for colors (background-green, color-green, etc.) and use those instead of inline styles
  • Videos are already not inline, so I think we're good there
  • Instead of using images as inline background styles, use a <figure> element to place them inside of the container and position the same way we're doing with "background" videos

This would get us away from adding inline styles to our blocks at all, as everything would either be handled by a class (background colors, text colors) or inline elements positioned as background elements (videos, images).

@sarthak0906
Copy link

Is the issue still open is it closed
If the issue is still open, I'll like to take up the task

@coreymcollins
Copy link
Contributor Author

@sarthak0906 – this has already been worked on and PR'd, but thanks for checking!

@gregrickaby
Copy link
Contributor

Closing per #409

coreymcollins added a commit that referenced this issue Oct 19, 2018
# Conflicts:
#	style.css
#	style.min.css
gregrickaby pushed a commit that referenced this issue Oct 19, 2018
* Adds a color picker field group

* Replaces standard ACF color picker with our select color picker

* Adds a function to set/get our color names

* Replaces background and font color inline styles with classes

* Renames “Block Options” field group to “Other Options” since that’s what it’s called in our block tabs

* Replaces image inline styles with <figure> markup positioned similarly to our video “background”

* Adjusts styles for video and image backgrounds

* Removes references to inline styles in markup

* Removes playsinline as it throws a 508 error

* Adds missing quotation marks around link in hero

* Compiles styles

* Removes our ACF admin enqueues for color picker

* Adjusts the color picker description and name

* Adjusts inline comments

* Sets the image and video as aria-hidden so screen readers don’t try to read them

* Replaces translation functions
gregrickaby added a commit that referenced this issue Oct 26, 2018
commit f377ae0
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 14:24:01 2018 -0500

    Theme/extras hooks cleanup (#430)

    * Removes our WDS placeholder function – placeholder.wdslab.com no longer appears to be a thing

    * Moves the header and footer script hooks into hooks since they’re hooks

    * Sets default width and height on the Unsplash template tag, otherwise it fails if no args are provided

    * Moves the ACF color picker filter into the ACF file since it’s ACF

    * Removes the commented out sidebars from our registration. We have one example on how to add a sidebar, I don’t think we need two commented out lines

    * Ignores the nonce verification PHPCS warnings on our debug mode checkers

commit a6403bc
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 14:20:49 2018 -0500

    Theme/#413 accordion block (#416)

    * Adds an accordion block and alphabetizes ACF field groups

    * Adds the beginnings of the accordion content block template

    * Fixes a typo in the field name

    * Adds the base accordion JS

    * Adjusts class names

    * Adds accordion styles

    * Compiles

    * Adjusts the accordion item IDs for multiple accordions on one page

    * Updates markup for better screen reading

    * Removes an extra div we probably don’t need

    * Updates a class name

    * Adjusts class names and removes unneeded styles

    * Compiles

    * Updates the button’s screen reader text

    * Tweaks block order

    * Adds intval to the $count variable

    * Adjusts JS (and styles to match) to only hide other opened accordions in the current block, not others, when opening one

    * Compiles

    * Changes the max-height value

    * Adds a no-js fallback

    * Compiles

    * Adds aria-expanded attributes to the accordion trigger buttons

    * Compiles

    * Adjusts button markup a bit and adds more aria attributes

    * Adjusts button styles for updated markup

    * Adjusts aria attribute settings for various conditions

    * Compiles

    * Fixes an alphabetical ordering issue

    * Adds/adjusts aria labels for accordion

    * Compiles

    * Adjusts some CSS transitions

    * Compiles

    * Adjusts no JS styles for the updated button markup to only hide the icon, not the full toggle (accordion heading)

    * Compiles

    * Removed Google+

    * Build 💻

    * Updated icomoon selection file to delete Google+ instance.

    * fixes typo, updated documentation to reflect function, and changes attribution.

    * Renames the function from icon to color

    * Fixes some weird “precision spacing” issues VS Code was throwing up

    * Fixes another typo from fiueld to field

    * Removes the panel removal of Nav Menus and Widgets, as this isn’t the way to do it (#420)

    * ♻️

commit e453fe9
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 14:11:09 2018 -0500

    Removes the panel removal of Nav Menus and Widgets, as this isn’t the way to do it (#420)

commit e50ef83
Merge: 1da8c2a 999ec11
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 11:21:43 2018 -0500

    Merge pull request #428 from WebDevStudios/hotfix/color_function_typo_fixes

    fixes typo, updated documentation to reflect function, and changes at…

commit 999ec11
Author: Corey Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 11:20:03 2018 -0500

    Fixes another typo from fiueld to field

commit abafb03
Author: Corey Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 11:16:30 2018 -0500

    Fixes some weird “precision spacing” issues VS Code was throwing up

commit 9b46d91
Author: Corey Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 11:14:09 2018 -0500

    Renames the function from icon to color

commit 97c4917
Author: jomurgel <dev@jomurgel.com>
Date:   Fri Oct 26 09:39:47 2018 -0600

    fixes typo, updated documentation to reflect function, and changes attribution.

commit 1da8c2a
Merge: d1be51d b0e420c
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Wed Oct 24 12:49:25 2018 -0400

    Merge pull request #418 from WebDevStudios/theme/#415-Remove-Google+

    Theme/#415 remove google+

commit b0e420c
Author: Muhammad Haris <isharis@gmail.com>
Date:   Wed Oct 24 18:21:00 2018 +0500

    Updated icomoon selection file to delete Google+ instance.

commit 391f5fc
Author: Muhammad Haris <isharis@gmail.com>
Date:   Wed Oct 24 00:31:09 2018 +0500

    Build 💻

commit e31eae1
Author: Muhammad Haris <isharis@gmail.com>
Date:   Wed Oct 24 00:29:32 2018 +0500

    Removed Google+

commit d1be51d
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 15:05:14 2018 -0400

    Theme/#408 remove inline styles (#409)

    * Adds a color picker field group

    * Replaces standard ACF color picker with our select color picker

    * Adds a function to set/get our color names

    * Replaces background and font color inline styles with classes

    * Renames “Block Options” field group to “Other Options” since that’s what it’s called in our block tabs

    * Replaces image inline styles with <figure> markup positioned similarly to our video “background”

    * Adjusts styles for video and image backgrounds

    * Removes references to inline styles in markup

    * Removes playsinline as it throws a 508 error

    * Adds missing quotation marks around link in hero

    * Compiles styles

    * Removes our ACF admin enqueues for color picker

    * Adjusts the color picker description and name

    * Adjusts inline comments

    * Sets the image and video as aria-hidden so screen readers don’t try to read them

    * Replaces translation functions

commit 4535426
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 14:32:58 2018 -0400

    Theme/general theme enhancements (#411)

    * Adds numeric pagination template tag

    * Replaces instances of the_post_navigation with new numeric pagination template tag

    * Removes the taxonomy name from the title of term archive pages

    * Fixes an equal sign alignment issue

    * Replaces <button> with <a> tag in CTA block

    * Checks for button text in the CTA button so we don’t potentially get an empty button

    * REplaces <button> with <a> tag in post card

    * Adds BG color transition

    * Sets a BG color transition on buttons globally

    * Sets opacity on links globally to use already-in-place link opacity transition

    * Compiles styles

    * Overrides a comment form button style

    * Condenses states for buttons

    * Compiles styles

commit 3455c40
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 10:08:46 2018 -0400

    Theme/move external css files (#407)

    * Moves normalize and animate stylesheets into the theme to avoid an extra external call

    * Compiles

commit be6da10
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 10:01:24 2018 -0400

    Theme/menu refinements (#410)

    * Moves the footer/mobile menu to a template tag

    * Adjusts output of menu and menu trigger in header

commit eb87d93
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 09:46:26 2018 -0400

    Replaces return with continue in expiration check (#404)

    * Replaces return with continue in expiration check

    * Removes the return comment from the doc block

commit bec21c3
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Mon Oct 1 12:13:21 2018 -0500

    Hotfix/#399 attribute spacing (#400)

    * Adjusts spacing for animation class to not end up with potentially empty space in attribute

    * Removes spaces at the end of inline styles so we don’t end up with an empty space at the end of the attribute

commit 910aece
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Mon Oct 1 12:12:34 2018 -0500

    Theme/#397 og meta tags (#398)

    * Adds a first pass at default OG tags

    * Updates for home and front page

    * Strips shortcodes from post content

    * Replaces __ with esc_html in strings

    * Checks for post content before stripping tags

    * Wraps ternary checks in parenteheses

    * Tweaks esc_html calls to esc_html__

    * Checks for singular before setting $post global

    * Updates a variable setting for long description on terms

    * Adds a check for attachment (media) singles

    * Simplifies the attachment card image conditional

commit 5ad134e
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Wed Sep 26 14:29:56 2018 -0500

    Replaces the <button> with an <input> to submit search results form (#395)

    * Replaces the <button> with an <input> to submit search results form

    * Adds a hyphen between searchsubmit to make it search-submit

    * Replaces/updates esc_attr strings

commit d3d7473
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Tue Sep 25 13:57:37 2018 -0500

    Updates ACF Block Defaults (#396)

    * Adds has-background classes for ACF blocks when color, image, or video are used

    * Swaps video class names for consistency

    * Changes z-index for video-background to -1 to sit behind content

    * Adjusts global block styles to keep video from breaking out of container

    * Adds a custom ID field to Other Options in global content blocks

    * Sets a default ID for content blocks and replaces it with the custom ID if one is set

    * Compiles styles

commit 8e15270
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Tue Sep 25 13:47:16 2018 -0500

    Adds filters to search post meta using default WP search (#393)

commit 4278c82
Author: Haris Zulfiqar <mharis@users.noreply.github.com>
Date:   Wed Sep 19 19:39:21 2018 +0500

    Fixes JS lint errors (#392)

commit a2dfc50
Author: Haris Zulfiqar <mharis@users.noreply.github.com>
Date:   Wed Sep 19 19:38:40 2018 +0500

    Hotfix/#387 css lint fixes (#390)

    * Remove empty rulesets

    * Added wp-block-button__link to class name format ignore

    * Compiled CSS

commit bc97fcb
Author: Haris Zulfiqar <mharis@users.noreply.github.com>
Date:   Wed Sep 19 19:37:59 2018 +0500

    PHPCS Warnings and Error Fixes (#388)
gregrickaby added a commit that referenced this issue Oct 26, 2018
commit f377ae0
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 14:24:01 2018 -0500

    Theme/extras hooks cleanup (#430)

    * Removes our WDS placeholder function – placeholder.wdslab.com no longer appears to be a thing

    * Moves the header and footer script hooks into hooks since they’re hooks

    * Sets default width and height on the Unsplash template tag, otherwise it fails if no args are provided

    * Moves the ACF color picker filter into the ACF file since it’s ACF

    * Removes the commented out sidebars from our registration. We have one example on how to add a sidebar, I don’t think we need two commented out lines

    * Ignores the nonce verification PHPCS warnings on our debug mode checkers

commit a6403bc
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 14:20:49 2018 -0500

    Theme/#413 accordion block (#416)

    * Adds an accordion block and alphabetizes ACF field groups

    * Adds the beginnings of the accordion content block template

    * Fixes a typo in the field name

    * Adds the base accordion JS

    * Adjusts class names

    * Adds accordion styles

    * Compiles

    * Adjusts the accordion item IDs for multiple accordions on one page

    * Updates markup for better screen reading

    * Removes an extra div we probably don’t need

    * Updates a class name

    * Adjusts class names and removes unneeded styles

    * Compiles

    * Updates the button’s screen reader text

    * Tweaks block order

    * Adds intval to the $count variable

    * Adjusts JS (and styles to match) to only hide other opened accordions in the current block, not others, when opening one

    * Compiles

    * Changes the max-height value

    * Adds a no-js fallback

    * Compiles

    * Adds aria-expanded attributes to the accordion trigger buttons

    * Compiles

    * Adjusts button markup a bit and adds more aria attributes

    * Adjusts button styles for updated markup

    * Adjusts aria attribute settings for various conditions

    * Compiles

    * Fixes an alphabetical ordering issue

    * Adds/adjusts aria labels for accordion

    * Compiles

    * Adjusts some CSS transitions

    * Compiles

    * Adjusts no JS styles for the updated button markup to only hide the icon, not the full toggle (accordion heading)

    * Compiles

    * Removed Google+

    * Build 💻

    * Updated icomoon selection file to delete Google+ instance.

    * fixes typo, updated documentation to reflect function, and changes attribution.

    * Renames the function from icon to color

    * Fixes some weird “precision spacing” issues VS Code was throwing up

    * Fixes another typo from fiueld to field

    * Removes the panel removal of Nav Menus and Widgets, as this isn’t the way to do it (#420)

    * ♻️

commit e453fe9
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 14:11:09 2018 -0500

    Removes the panel removal of Nav Menus and Widgets, as this isn’t the way to do it (#420)

commit e50ef83
Merge: 1da8c2a 999ec11
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 11:21:43 2018 -0500

    Merge pull request #428 from WebDevStudios/hotfix/color_function_typo_fixes

    fixes typo, updated documentation to reflect function, and changes at…

commit 999ec11
Author: Corey Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 11:20:03 2018 -0500

    Fixes another typo from fiueld to field

commit abafb03
Author: Corey Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 11:16:30 2018 -0500

    Fixes some weird “precision spacing” issues VS Code was throwing up

commit 9b46d91
Author: Corey Collins <coreymcollins@gmail.com>
Date:   Fri Oct 26 11:14:09 2018 -0500

    Renames the function from icon to color

commit 97c4917
Author: jomurgel <dev@jomurgel.com>
Date:   Fri Oct 26 09:39:47 2018 -0600

    fixes typo, updated documentation to reflect function, and changes attribution.

commit 1da8c2a
Merge: d1be51d b0e420c
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Wed Oct 24 12:49:25 2018 -0400

    Merge pull request #418 from WebDevStudios/theme/#415-Remove-Google+

    Theme/#415 remove google+

commit b0e420c
Author: Muhammad Haris <isharis@gmail.com>
Date:   Wed Oct 24 18:21:00 2018 +0500

    Updated icomoon selection file to delete Google+ instance.

commit 391f5fc
Author: Muhammad Haris <isharis@gmail.com>
Date:   Wed Oct 24 00:31:09 2018 +0500

    Build 💻

commit e31eae1
Author: Muhammad Haris <isharis@gmail.com>
Date:   Wed Oct 24 00:29:32 2018 +0500

    Removed Google+

commit d1be51d
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 15:05:14 2018 -0400

    Theme/#408 remove inline styles (#409)

    * Adds a color picker field group

    * Replaces standard ACF color picker with our select color picker

    * Adds a function to set/get our color names

    * Replaces background and font color inline styles with classes

    * Renames “Block Options” field group to “Other Options” since that’s what it’s called in our block tabs

    * Replaces image inline styles with <figure> markup positioned similarly to our video “background”

    * Adjusts styles for video and image backgrounds

    * Removes references to inline styles in markup

    * Removes playsinline as it throws a 508 error

    * Adds missing quotation marks around link in hero

    * Compiles styles

    * Removes our ACF admin enqueues for color picker

    * Adjusts the color picker description and name

    * Adjusts inline comments

    * Sets the image and video as aria-hidden so screen readers don’t try to read them

    * Replaces translation functions

commit 4535426
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 14:32:58 2018 -0400

    Theme/general theme enhancements (#411)

    * Adds numeric pagination template tag

    * Replaces instances of the_post_navigation with new numeric pagination template tag

    * Removes the taxonomy name from the title of term archive pages

    * Fixes an equal sign alignment issue

    * Replaces <button> with <a> tag in CTA block

    * Checks for button text in the CTA button so we don’t potentially get an empty button

    * REplaces <button> with <a> tag in post card

    * Adds BG color transition

    * Sets a BG color transition on buttons globally

    * Sets opacity on links globally to use already-in-place link opacity transition

    * Compiles styles

    * Overrides a comment form button style

    * Condenses states for buttons

    * Compiles styles

commit 3455c40
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 10:08:46 2018 -0400

    Theme/move external css files (#407)

    * Moves normalize and animate stylesheets into the theme to avoid an extra external call

    * Compiles

commit be6da10
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 10:01:24 2018 -0400

    Theme/menu refinements (#410)

    * Moves the footer/mobile menu to a template tag

    * Adjusts output of menu and menu trigger in header

commit eb87d93
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Fri Oct 19 09:46:26 2018 -0400

    Replaces return with continue in expiration check (#404)

    * Replaces return with continue in expiration check

    * Removes the return comment from the doc block

commit bec21c3
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Mon Oct 1 12:13:21 2018 -0500

    Hotfix/#399 attribute spacing (#400)

    * Adjusts spacing for animation class to not end up with potentially empty space in attribute

    * Removes spaces at the end of inline styles so we don’t end up with an empty space at the end of the attribute

commit 910aece
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Mon Oct 1 12:12:34 2018 -0500

    Theme/#397 og meta tags (#398)

    * Adds a first pass at default OG tags

    * Updates for home and front page

    * Strips shortcodes from post content

    * Replaces __ with esc_html in strings

    * Checks for post content before stripping tags

    * Wraps ternary checks in parenteheses

    * Tweaks esc_html calls to esc_html__

    * Checks for singular before setting $post global

    * Updates a variable setting for long description on terms

    * Adds a check for attachment (media) singles

    * Simplifies the attachment card image conditional

commit 5ad134e
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Wed Sep 26 14:29:56 2018 -0500

    Replaces the <button> with an <input> to submit search results form (#395)

    * Replaces the <button> with an <input> to submit search results form

    * Adds a hyphen between searchsubmit to make it search-submit

    * Replaces/updates esc_attr strings

commit d3d7473
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Tue Sep 25 13:57:37 2018 -0500

    Updates ACF Block Defaults (#396)

    * Adds has-background classes for ACF blocks when color, image, or video are used

    * Swaps video class names for consistency

    * Changes z-index for video-background to -1 to sit behind content

    * Adjusts global block styles to keep video from breaking out of container

    * Adds a custom ID field to Other Options in global content blocks

    * Sets a default ID for content blocks and replaces it with the custom ID if one is set

    * Compiles styles

commit 8e15270
Author: Corey M Collins <coreymcollins@gmail.com>
Date:   Tue Sep 25 13:47:16 2018 -0500

    Adds filters to search post meta using default WP search (#393)

commit 4278c82
Author: Haris Zulfiqar <mharis@users.noreply.github.com>
Date:   Wed Sep 19 19:39:21 2018 +0500

    Fixes JS lint errors (#392)

commit a2dfc50
Author: Haris Zulfiqar <mharis@users.noreply.github.com>
Date:   Wed Sep 19 19:38:40 2018 +0500

    Hotfix/#387 css lint fixes (#390)

    * Remove empty rulesets

    * Added wp-block-button__link to class name format ignore

    * Compiled CSS

commit bc97fcb
Author: Haris Zulfiqar <mharis@users.noreply.github.com>
Date:   Wed Sep 19 19:37:59 2018 +0500

    PHPCS Warnings and Error Fixes (#388)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants