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

Add default placeholder icons #13730

Merged

Conversation

cathyxz
Copy link
Contributor

@cathyxz cathyxz commented Mar 1, 2018

Add default placeholder icons from design.

screen shot 2018-02-28 at 6 17 28 pm

screen shot 2018-02-28 at 6 17 45 pm

screen shot 2018-02-28 at 6 17 59 pm

@cathyxz cathyxz force-pushed the feature/lightbox-thumbnail-placeholders branch from f4f59c8 to 742bb62 Compare March 1, 2018 02:16
@cathyxz cathyxz changed the title :crayon: Add default placeholder icons 🖍️ Add default placeholder icons Mar 1, 2018
@cathyxz cathyxz changed the title 🖍️ Add default placeholder icons Add default placeholder icons Mar 1, 2018
@cathyxz cathyxz force-pushed the feature/lightbox-thumbnail-placeholders branch from 742bb62 to 06803db Compare March 1, 2018 17:53
@@ -13,4 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const defaultPlaceholder = 'data:image/svg+xml;charset=utf-8,<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"/><path d="M0 0h24v24H0z" fill="none"/></svg>';
export const LIGHTBOX_THUMBNAIL_UNKNOWN = 'data:image/svg+xml;charset=utf-8,<svg width="128px" height="128px" viewBox="0 0 128 128" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path d="M33,24.5 L95,24.5 C97.209139,24.5 99,26.290861 99,28.5 L99,85.452381 L80.0810811,104.5 L33,104.5 C30.790861,104.5 29,102.709139 29,100.5 L29,28.5 C29,26.290861 30.790861,24.5 33,24.5 Z" id="path-1"></path><path d="M82,83.5 L99,83.5 L99,85.5 L79.9991047,104.500895 L78,104.5 L78,87.5 C78,85.290861 79.790861,83.5 82,83.5 Z" id="path-2"></path></defs><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="amp_placeholders_v2" transform="translate(-613.000000, -686.000000)"></g><g id="unknown_03"><rect id="Rectangle-path" fill="#E6EFF9" x="0" y="0" width="128" height="128"></rect><g id="Rectangle-7"><use fill="#F9FCFF" fill-rule="evenodd" xlink:href="#path-1"></use><path stroke="#3C587E" stroke-width="2" d="M79.6648804,103.5 L98,85.0401517 L98,28.5 C98,26.8431458 96.6568542,25.5 95,25.5 L33,25.5 C31.3431458,25.5 30,26.8431458 30,28.5 L30,100.5 C30,102.156854 31.3431458,103.5 33,103.5 L79.6648804,103.5 Z"></path></g><g id="Rectangle"><use fill="#C1D4EE" fill-rule="evenodd" xlink:href="#path-2"></use><path stroke="#3C587E" stroke-width="2" d="M79,103.500448 L79.5850767,103.50071 L98,85.0857864 L98,84.5 L82,84.5 C80.3431458,84.5 79,85.8431458 79,87.5 L79,103.500448 Z"></path></g></g></g></svg>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be in CSS so they go through the SVG optimization in our build process. Use the JS to apply classnames necessary to add the background images. Right now these SVGs are not optimized for size, since I see extraneous id attributes and <g> tags. You can also manually optimize them with svgo and look for what settings we use for our automatic process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good to know!

The only svgo options I found were these in jsify-css.js:

svgo: {
    encode: true,
  },

But they don't seem to mean much in svgo's cmdline tool. Am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the encode option is cssnano specific: https://github.com/ben-eb/cssnano/tree/master/packages/postcss-svgo
I don't think it's needed here

Copy link
Contributor

@cvializ cvializ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

LIGHTBOX_THUMBNAIL_GIF,
LIGHTBOX_THUMBNAIL_UNKNOWN,
LIGHTBOX_THUMBNAIL_VIDEO,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra line

Copy link
Contributor

@aghassemi aghassemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (the implementations :) I have voiced my opinion about the icons separately)

@cathyxz
Copy link
Contributor Author

cathyxz commented Mar 1, 2018

Yup, it will be easy to switch out the icons when we finalize them.

@cathyxz cathyxz merged commit bd11528 into ampproject:master Mar 1, 2018
@cathyxz cathyxz deleted the feature/lightbox-thumbnail-placeholders branch March 1, 2018 21:50
RanAbram pushed a commit to RanAbram/amphtml that referenced this pull request Mar 12, 2018
* Add default placeholder icons

* Manually optimize svgs with svgo

* Remove extra line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants