SlideShare a Scribd company logo
1 of 23
Download to read offline
COMPASS SPRITING
  SPRITES ERSTELLEN MIT COMPASS
        ©2012 Michael van Engelshoven
WAS SIND SPRITES?
SPRITES MINIMIEREN DIE ANZAHL DER REQUESTS
So lässt sich eine Seite schneller ausliefern. Speziell
      wenn viele kleine Bilder benutzt werden
ALLE ICONS IN EINEM BILD ANORDNEN
SPRITE IM CSS DEFINIEREN
.ete-la-a,
 wahrcerdy
.ete-la-ih,
 wahrcerngt
.ete-lul-a,
 wahrcodydy
.ete-lul-ih {
 wahrcodyngt
   bcgon-mg:ul/mgseapesrt.n)
    akrudiae r(iae/xml-piepg;
   bcgon-eet n-eet
    akrudrpa: orpa;
}

.ete-la-a
 wahrcerdy   {bcgon-oiin 00 }
               akrudpsto:  ;
.ete-la-ih
 wahrcerngt {bcgon-oiin 20x0 }
               akrudpsto: 0p ;
.ete-lul-a
 wahrcodydy {bcgon-oiin 20x0 }
               akrudpsto: 5p ;
.ete-lul-ih {bcgon-oiin 30x0 }
 wahrcodyngt   akrudpsto: 0p ;
BEISPIEL FACEBOOK
BEISPIEL WUNDERLIST2
UND WIE HILFT UNS JETZT COMPASS?
EINZELNE BILDER IN EIN VERZEICHNIS KOPIEREN
[mgsdr/
 iae_i]
   srts
    pie/
      wahr
       ete/
        cerdypg
         la-a.n
        cerngtpg
         la-ih.n
        codydypg
         lul-a.n
        codyngtpg
         lul-ih.n
SPRITE IN EIN COMPASS-STYLESHEET EINBINEN
@mot"pie/ete/.n"
 ipr srtswahr*pg;
@nld alwahrsrts
 icue l-ete-pie;
UND WIR BEKOMMEN
.ete-pie
 wahrsrt,
.ete-la-ih,
 wahrcerngt
.ete-lul-a,
 wahrcodydy
.ete-lul-ih {
 wahrcodyngt
   bcgon:ul'iae/ete-3f00a.n' n-eet
    akrud r(/mgswahrs4e64bpg) orpa;
}

.ete-la-a
 wahrcerdy   {bcgon-oiin 00 }
               akrudpsto:  ;
.ete-la-ih
 wahrcerngt {bcgon-oiin 20x0 }
               akrudpsto: 0p ;
.ete-lul-a
 wahrcodydy {bcgon-oiin 20x0 }
               akrudpsto: 5p ;
.ete-lul-ih {bcgon-oiin 30x0 }
 wahrcodyngt   akrudpsto: 0p ;
SPRITES EINZELN EINBINDEN
@mot"pie/ete/.n"
 ipr srtswahr*pg;

.ete-igtdy.lul {
 wahrwde.a cody
   @nld wahrsrt(codydy)
    icue ete-pie"lul-a";
}
MAGIC SELECTORS
DATEIEN MIT SUFFIXEN VERSEHEN
[mgsdr/
 iae_i]
   btos
    utn/
      gos.n
       lsypg
      gos_oe.n
       lsyhvrpg
      gos_ciepg
       lsyatv.n
      gos_agtpg
       lsytre.n
SPRITES WIE GEHABT EINBINDEN
@mot"pie/utn/.n"
 ipr srtsbtos*pg;

a {
   @nld btossrt(gos";
    icue utn-pie"lsy)
}
COMPASS MACHT DEN REST
btossrt,a{
 utn-pie
  bcgon:ul'btossde892pg)n-eet
   akrud r(/utn-eff0e.n' orpa;
}

a{
  bcgon-oiin 00
   akrudpsto:  ;
}
ahvr agos_oe,agos-oe {
 :oe, .lsyhvr .lsyhvr
  bcgon-oiin 0-0x
   akrudpsto:  4p;
}
atre,agos_agt agos-agt{
 :agt .lsytre, .lsytre
  bcgon-oiin 0-0x
   akrudpsto:  6p;
}
aatv,agos_cie agos-cie{
 :cie .lsyatv, .lsyatv
  bcgon-oiin 0-0
   akrudpsto:  2;
}
SPRITEMAP
Eine Spritemap wird automatisch durch das importieren
                  der Bilder erzeugt.
  @mot"pie/ete/.n"
   ipr srtswahr*pg;
  $ete-pie / EtätdeSrtmp
   wahrsrts / nhl i piea
SPRITEMAP
Wir können aber auch eine eigene Spritemap über einen
                  Glob definieren.
  $cn:srt-a(ios*pg)
   ios piemp"cn/.n";

  .pie {
   srts
     bcgon-mg:srt-r(ios;
      akrudiae pieul$cn)
  }
GRÖSSE EINES ICONS VERWENDEN
$eteSrt:srt-a(srtswahr*pg)
 wahrpie piemp"pie/ete/.n";

.ete-igtdy.lul {
 wahrwde.a cody
   $ae "lul-a"
    nm: codydy;
   $egt iaehih(piefl(wahrpie $ae)
    hih: mg-egtsrt-ie$eteSrt, nm);

    @nld srt-iesos$eteSrt,$ae;
     icue piedmnin(wahrpie nm)

    bcgon:srt(wahrpie $ae;
     akrud pie$eteSrt, nm)
    mri-o:0-$egt2
     agntp   hih/;
    tp 5%
     o: 0;
}
VIEL SPASS!
http://slidesha.re/W1R1Nh
REFERENZEN
Compass Dokumentation
  Image Dimension Helpers
  Sprite Helpers
  Spriting Tutorial
Compass Source auf Github

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Compass Sprites

  • 1. COMPASS SPRITING SPRITES ERSTELLEN MIT COMPASS ©2012 Michael van Engelshoven
  • 3. SPRITES MINIMIEREN DIE ANZAHL DER REQUESTS So lässt sich eine Seite schneller ausliefern. Speziell wenn viele kleine Bilder benutzt werden
  • 4. ALLE ICONS IN EINEM BILD ANORDNEN
  • 5. SPRITE IM CSS DEFINIEREN .ete-la-a, wahrcerdy .ete-la-ih, wahrcerngt .ete-lul-a, wahrcodydy .ete-lul-ih { wahrcodyngt bcgon-mg:ul/mgseapesrt.n) akrudiae r(iae/xml-piepg; bcgon-eet n-eet akrudrpa: orpa; } .ete-la-a wahrcerdy {bcgon-oiin 00 } akrudpsto: ; .ete-la-ih wahrcerngt {bcgon-oiin 20x0 } akrudpsto: 0p ; .ete-lul-a wahrcodydy {bcgon-oiin 20x0 } akrudpsto: 5p ; .ete-lul-ih {bcgon-oiin 30x0 } wahrcodyngt akrudpsto: 0p ;
  • 8.
  • 9. UND WIE HILFT UNS JETZT COMPASS?
  • 10. EINZELNE BILDER IN EIN VERZEICHNIS KOPIEREN [mgsdr/ iae_i] srts pie/ wahr ete/ cerdypg la-a.n cerngtpg la-ih.n codydypg lul-a.n codyngtpg lul-ih.n
  • 11. SPRITE IN EIN COMPASS-STYLESHEET EINBINEN @mot"pie/ete/.n" ipr srtswahr*pg; @nld alwahrsrts icue l-ete-pie;
  • 12. UND WIR BEKOMMEN .ete-pie wahrsrt, .ete-la-ih, wahrcerngt .ete-lul-a, wahrcodydy .ete-lul-ih { wahrcodyngt bcgon:ul'iae/ete-3f00a.n' n-eet akrud r(/mgswahrs4e64bpg) orpa; } .ete-la-a wahrcerdy {bcgon-oiin 00 } akrudpsto: ; .ete-la-ih wahrcerngt {bcgon-oiin 20x0 } akrudpsto: 0p ; .ete-lul-a wahrcodydy {bcgon-oiin 20x0 } akrudpsto: 5p ; .ete-lul-ih {bcgon-oiin 30x0 } wahrcodyngt akrudpsto: 0p ;
  • 13. SPRITES EINZELN EINBINDEN @mot"pie/ete/.n" ipr srtswahr*pg; .ete-igtdy.lul { wahrwde.a cody @nld wahrsrt(codydy) icue ete-pie"lul-a"; }
  • 15. DATEIEN MIT SUFFIXEN VERSEHEN [mgsdr/ iae_i] btos utn/ gos.n lsypg gos_oe.n lsyhvrpg gos_ciepg lsyatv.n gos_agtpg lsytre.n
  • 16. SPRITES WIE GEHABT EINBINDEN @mot"pie/utn/.n" ipr srtsbtos*pg; a { @nld btossrt(gos"; icue utn-pie"lsy) }
  • 17. COMPASS MACHT DEN REST btossrt,a{ utn-pie bcgon:ul'btossde892pg)n-eet akrud r(/utn-eff0e.n' orpa; } a{ bcgon-oiin 00 akrudpsto: ; } ahvr agos_oe,agos-oe { :oe, .lsyhvr .lsyhvr bcgon-oiin 0-0x akrudpsto: 4p; } atre,agos_agt agos-agt{ :agt .lsytre, .lsytre bcgon-oiin 0-0x akrudpsto: 6p; } aatv,agos_cie agos-cie{ :cie .lsyatv, .lsyatv bcgon-oiin 0-0 akrudpsto: 2; }
  • 18. SPRITEMAP Eine Spritemap wird automatisch durch das importieren der Bilder erzeugt. @mot"pie/ete/.n" ipr srtswahr*pg; $ete-pie / EtätdeSrtmp wahrsrts / nhl i piea
  • 19. SPRITEMAP Wir können aber auch eine eigene Spritemap über einen Glob definieren. $cn:srt-a(ios*pg) ios piemp"cn/.n"; .pie { srts bcgon-mg:srt-r(ios; akrudiae pieul$cn) }
  • 20. GRÖSSE EINES ICONS VERWENDEN $eteSrt:srt-a(srtswahr*pg) wahrpie piemp"pie/ete/.n"; .ete-igtdy.lul { wahrwde.a cody $ae "lul-a" nm: codydy; $egt iaehih(piefl(wahrpie $ae) hih: mg-egtsrt-ie$eteSrt, nm); @nld srt-iesos$eteSrt,$ae; icue piedmnin(wahrpie nm) bcgon:srt(wahrpie $ae; akrud pie$eteSrt, nm) mri-o:0-$egt2 agntp hih/; tp 5% o: 0; }
  • 23. REFERENZEN Compass Dokumentation Image Dimension Helpers Sprite Helpers Spriting Tutorial Compass Source auf Github