Class: Tenon::Configuration::BreakpointConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/tenon/config/breakpoints.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBreakpointConfiguration



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/tenon/config/breakpoints.rb', line 12

def initialize
  # Define all your breakpoints and associated tenon_content widths.
  # This is necessary because you may have multiple models with tenon_content
  # with different maximum widths and therefore different widths at various
  # breakpoints. By getting more precise with these widths we can serve the
  # most efficient responsive images to the front end.
  @front_end = {
    full: {
      browser: 1920, # the width of the browser for this breakpoint
      default: 1920, # default tenon_content width for piece's without specific widths
      page: 1920, # the width of tenon_content for Pages
      post: 1920 # the width of tenon_content for Posts
    },
    desktop: {
      browser: 1400,
      default: 1400,
      page: 1400,
      post: 1400
    },
    laptop: {
      browser: 960,
      default: 960,
      page: 960,
      post: 960
    },
    tablet: {
      browser: 768,
      default: 768,
      page: 768,
      post: 768
    }
  }

  # set up the back-end breakpoints and associated tenon_content widths since
  # we know what they always are
  @back_end = {
    full: {
      browser: 1920,
      default: 1225
    },
    desktop: {
      browser: 1400,
      default: 740
    },
    laptop: {
      browser: 960,
      default: 680
    },
    tablet: {
      browser: 768,
      default: 750
    }
  }

  @grid = {
    columns: 24,
    gutter: 20,

    content_columns: {
      default: 18
    }
  }
end

Instance Attribute Details

#back_endObject

Returns the value of attribute back_end.



10
11
12
# File 'lib/tenon/config/breakpoints.rb', line 10

def back_end
  @back_end
end

#front_endObject

Returns the value of attribute front_end.



10
11
12
# File 'lib/tenon/config/breakpoints.rb', line 10

def front_end
  @front_end
end

#gridObject

Returns the value of attribute grid.



10
11
12
# File 'lib/tenon/config/breakpoints.rb', line 10

def grid
  @grid
end